Skip to content

Commit

Permalink
Add namespace to unityLibrary export.
Browse files Browse the repository at this point in the history
  • Loading branch information
timbotimbo committed Jun 25, 2024
1 parent 8cfb5e6 commit 62b56a1
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,14 @@ private static void ModifyAndroidGradle(bool isPlugin)
buildText = buildText.Replace(" + unityStreamingAssets.tokenize(', ')", "");
buildText = Regex.Replace(buildText, "ndkPath \".*\"", "");

// check for namespace definition (Android gradle plugin 8+), add a backwards compatible version if it is missing.
if(!buildText.Contains("namespace"))
{
buildText = buildText.Replace("compileOptions {",
"if (project.android.hasProperty(\"namespace\")) {\n namespace 'com.unity3d.player'\n }\n\n compileOptions {"
);
}

if(isPlugin)
{
buildText = Regex.Replace(buildText, @"implementation\(name: 'androidx.* ext:'aar'\)", "\n");
Expand Down

0 comments on commit 62b56a1

Please sign in to comment.