Skip to content

Uninstall Android platforms that fail with Unity #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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