@@ -210,14 +210,25 @@ private static void DoBuildAndroid(String buildPath, bool isPlugin, bool isRelea
210
210
// remove this line if you don't use a debugger and you want to speed up the flutter build
211
211
playerOptions . options = BuildOptions . AllowDebugging | BuildOptions . Development ;
212
212
}
213
- #if UNITY_2022_1_OR_NEWER
213
+ #if UNITY_6000_0_OR_NEWER
214
+ PlayerSettings . SetIl2CppCompilerConfiguration ( NamedBuildTarget . Android , isReleaseBuild ? Il2CppCompilerConfiguration . Release : Il2CppCompilerConfiguration . Debug ) ;
215
+ PlayerSettings . SetIl2CppCodeGeneration ( NamedBuildTarget . Android , isReleaseBuild ? Il2CppCodeGeneration . OptimizeSpeed : Il2CppCodeGeneration . OptimizeSize ) ;
216
+ #elif UNITY_2022_1_OR_NEWER
214
217
PlayerSettings . SetIl2CppCompilerConfiguration ( BuildTargetGroup . Android , isReleaseBuild ? Il2CppCompilerConfiguration . Release : Il2CppCompilerConfiguration . Debug ) ;
215
218
PlayerSettings . SetIl2CppCodeGeneration ( NamedBuildTarget . Android , isReleaseBuild ? Il2CppCodeGeneration . OptimizeSpeed : Il2CppCodeGeneration . OptimizeSize ) ;
216
219
#elif UNITY_2021_2_OR_NEWER
217
220
PlayerSettings . SetIl2CppCompilerConfiguration ( BuildTargetGroup . Android , isReleaseBuild ? Il2CppCompilerConfiguration . Release : Il2CppCompilerConfiguration . Debug ) ;
218
221
EditorUserBuildSettings . il2CppCodeGeneration = isReleaseBuild ? Il2CppCodeGeneration . OptimizeSpeed : Il2CppCodeGeneration . OptimizeSize ;
219
222
#endif
220
223
224
+
225
+ #if UNITY_ANDROID && UNITY_6000_0_OR_NEWER
226
+ UnityEditor . Android . UserBuildSettings . DebugSymbols . level = isReleaseBuild ? Unity . Android . Types . DebugSymbolLevel . None : Unity . Android . Types . DebugSymbolLevel . SymbolTable ;
227
+ UnityEditor . Android . UserBuildSettings . DebugSymbols . format = Unity . Android . Types . DebugSymbolFormat . LegacyExtensions ;
228
+ #endif
229
+ #if UNITY_ANDROID && UNITY_2023_1_OR_NEWER
230
+ PlayerSettings . Android . applicationEntry = AndroidApplicationEntry . Activity ;
231
+ #endif
221
232
// Switch to Android standalone build.
222
233
EditorUserBuildSettings . SwitchActiveBuildTarget ( BuildTargetGroup . Android , BuildTarget . Android ) ;
223
234
// build addressable
@@ -229,6 +240,13 @@ private static void DoBuildAndroid(String buildPath, bool isPlugin, bool isRelea
229
240
230
241
Copy ( buildPath , AndroidExportPath ) ;
231
242
243
+ // Unity 6000 shared folder
244
+ string sharedPath = Path . Combine ( APKPath , "shared" ) ;
245
+ if ( Directory . Exists ( sharedPath ) )
246
+ {
247
+ Copy ( sharedPath , Path . Combine ( AndroidExportPath , "shared" ) ) ;
248
+ }
249
+
232
250
// Modify build.gradle
233
251
ModifyAndroidGradle ( isPlugin ) ;
234
252
@@ -338,6 +356,10 @@ private static void ModifyAndroidGradle(bool isPlugin)
338
356
// disable the Unity ndk path as it will conflict with Flutter.
339
357
buildText = buildText . Replace ( "ndkPath \" " , "// ndkPath \" " ) ;
340
358
359
+ // Untiy 6000, handle ../shared/
360
+ buildText = Regex . Replace ( buildText , @"\.\./shared/" , "./shared/" ) ;
361
+
362
+
341
363
// check for namespace definition (Android gradle plugin 8+), add a backwards compatible version if it is missing.
342
364
if ( ! buildText . Contains ( "namespace" ) )
343
365
{
@@ -430,7 +452,10 @@ private static void BuildIOS(String path, bool isReleaseBuild)
430
452
EditorUserBuildSettings . iOSBuildConfigType = iOSBuildType . Release ;
431
453
#endif
432
454
433
- #if UNITY_2022_1_OR_NEWER
455
+ #if UNITY_6000_0_OR_NEWER
456
+ PlayerSettings . SetIl2CppCompilerConfiguration ( NamedBuildTarget . iOS , isReleaseBuild ? Il2CppCompilerConfiguration . Release : Il2CppCompilerConfiguration . Debug ) ;
457
+ PlayerSettings . SetIl2CppCodeGeneration ( NamedBuildTarget . iOS , isReleaseBuild ? Il2CppCodeGeneration . OptimizeSpeed : Il2CppCodeGeneration . OptimizeSize ) ;
458
+ #elif UNITY_2022_1_OR_NEWER
434
459
PlayerSettings . SetIl2CppCompilerConfiguration ( BuildTargetGroup . iOS , isReleaseBuild ? Il2CppCompilerConfiguration . Release : Il2CppCompilerConfiguration . Debug ) ;
435
460
PlayerSettings . SetIl2CppCodeGeneration ( NamedBuildTarget . iOS , isReleaseBuild ? Il2CppCodeGeneration . OptimizeSpeed : Il2CppCodeGeneration . OptimizeSize ) ;
436
461
#elif UNITY_2021_2_OR_NEWER
0 commit comments