Skip to content

Commit cfcc5eb

Browse files
authored
Fix Android export with Unity 6.2. #1039
1 parent d25e348 commit cfcc5eb

File tree

1 file changed

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

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,13 @@ private static void DoBuildAndroid(String buildPath, bool isPlugin, bool isRelea
297297
Copy(sharedPath, Path.Combine(AndroidExportPath, "shared"));
298298
}
299299

300+
// Unity 6.2 requires unity.androidNdkPath and unity.androidSdkPath from gradle.properties.
301+
// https://github.com/juicycleff/flutter-unity-view-widget/issues/1039
302+
#if UNITY_6000_2_OR_NEWER
303+
// Copy gradle.properties from the Unity output to android/unityLibrary/
304+
File.Copy(Path.Combine(APKPath, "gradle.properties"), Path.Combine(AndroidExportPath, "gradle.properties"), true);
305+
#endif
306+
300307
// Modify build.gradle
301308
ModifyAndroidGradle(isPlugin);
302309

0 commit comments

Comments
 (0)