Skip to content

Commit

Permalink
Uninstall Android platforms that fail with Unity (#436)
Browse files Browse the repository at this point in the history
* Uninstall Android platforms that fail with Unity

* Update build_testapps.py
  • Loading branch information
a-maurice authored Aug 4, 2022
1 parent a2b9bb5 commit 810318a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/gha/build_testapps.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,16 @@ def patch_android_env(unity_version):
logging.info("Uninstall Android build tool 31.0.0")
except Exception as e:
logging.info(str(e))

try:
# The platform android-33 includes libraries that were built with Java 11, and require a newer version of gradle
# than Unity comes with. Note this only happens when using minification.
# If this continues to be a problem, this logic might need to be smarter, to remove all versions newer than 32,
# but currently the GitHub runners have 33 as their max.
logging.info("Uninstall Android platform android-33")
_run([os.environ["ANDROID_HOME"]+"/tools/bin/sdkmanager", "--uninstall", "platforms;android-33"], check=False)
except Exception as e:
logging.exception("Failed to uninstall Android platform android-33")

os.environ["UNITY_ANDROID_SDK"]=os.environ["ANDROID_HOME"]
os.environ["UNITY_ANDROID_NDK"]=os.environ["ANDROID_NDK_HOME"]
Expand Down

0 comments on commit 810318a

Please sign in to comment.