Skip to content

Commit c2a2318

Browse files
Remove ndkPath from generated build.gradle
- Starting Unity 2023, Unity generates build.gradle with ndkPath which contains the absolute path to the NDK (e.g. `ndkPath "/Applications/Unity/Hub/Editor/2023.1.14f1/PlaybackEngines/AndroidPlayer/NDK"`). This causes the build to fail when tested on a different machine or when the ndk version is defined in the app level build.gradle.
1 parent 6fc738c commit c2a2318

File tree

1 file changed

+1
-0
lines changed
  • example/unity/DemoApp/Assets/FlutterUnityIntegration/Editor

1 file changed

+1
-0
lines changed

example/unity/DemoApp/Assets/FlutterUnityIntegration/Editor/Build.cs

+1
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ private static void ModifyAndroidGradle(bool isPlugin)
330330
buildText = buildText.Replace("enableSplit = true", "enable true");
331331
buildText = buildText.Replace("implementation fileTree(dir: 'libs', include: ['*.jar'])", "implementation(name: 'unity-classes', ext:'jar')");
332332
buildText = buildText.Replace(" + unityStreamingAssets.tokenize(', ')", "");
333+
buildText = Regex.Replace(buildText, "ndkPath \".*\"", "");
333334

334335
if(isPlugin)
335336
{

0 commit comments

Comments
 (0)