Skip to content

Commit 810318a

Browse files
authored
Uninstall Android platforms that fail with Unity (#436)
* Uninstall Android platforms that fail with Unity * Update build_testapps.py
1 parent a2b9bb5 commit 810318a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/gha/build_testapps.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,16 @@ def patch_android_env(unity_version):
527527
logging.info("Uninstall Android build tool 31.0.0")
528528
except Exception as e:
529529
logging.info(str(e))
530+
531+
try:
532+
# The platform android-33 includes libraries that were built with Java 11, and require a newer version of gradle
533+
# than Unity comes with. Note this only happens when using minification.
534+
# If this continues to be a problem, this logic might need to be smarter, to remove all versions newer than 32,
535+
# but currently the GitHub runners have 33 as their max.
536+
logging.info("Uninstall Android platform android-33")
537+
_run([os.environ["ANDROID_HOME"]+"/tools/bin/sdkmanager", "--uninstall", "platforms;android-33"], check=False)
538+
except Exception as e:
539+
logging.exception("Failed to uninstall Android platform android-33")
530540

531541
os.environ["UNITY_ANDROID_SDK"]=os.environ["ANDROID_HOME"]
532542
os.environ["UNITY_ANDROID_NDK"]=os.environ["ANDROID_NDK_HOME"]

0 commit comments

Comments
 (0)