File tree 1 file changed +8
-0
lines changed
example/unity/DemoApp/Assets/FlutterUnityIntegration/Editor
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,14 @@ private static void ModifyAndroidGradle(bool isPlugin)
332
332
buildText = buildText . Replace ( " + unityStreamingAssets.tokenize(', ')" , "" ) ;
333
333
buildText = Regex . Replace ( buildText , "ndkPath \" .*\" " , "" ) ;
334
334
335
+ // check for namespace definition (Android gradle plugin 8+), add a backwards compatible version if it is missing.
336
+ if ( ! buildText . Contains ( "namespace" ) )
337
+ {
338
+ buildText = buildText . Replace ( "compileOptions {" ,
339
+ "if (project.android.hasProperty(\" namespace\" )) {\n namespace 'com.unity3d.player'\n }\n \n compileOptions {"
340
+ ) ;
341
+ }
342
+
335
343
if ( isPlugin )
336
344
{
337
345
buildText = Regex . Replace ( buildText , @"implementation\(name: 'androidx.* ext:'aar'\)" , "\n " ) ;
You can’t perform that action at this time.
0 commit comments