Android builds fail on GH ubuntu-22.04 runners due to conflicting SDK variables
ennerf opened this issue · 0 comments
ennerf commented
Environment:
- runner:
ubuntu-22.04
- setup:
gluonhq/setup-graalvm@master
- gluonfx-plugin:
1.0.21
It looks like the GH runner defines an ANDROID_SDK_ROOT
variable that interferes with the ANDROID_HOME
variable and breaks the build.
- name: Build & Package Mobile Binary
run: mvn gluonfx:build gluonfx:package -Pandroid
Log file section:
[Tue Nov 14 15:28:55 UTC 2023][FINE] [SUB] * What went wrong:
[Tue Nov 14 15:28:55 UTC 2023][FINE] [SUB] Could not determine the dependencies of task ':app:lintVitalReportRelease'.
[Tue Nov 14 15:28:55 UTC 2023][FINE] [SUB] > Several environment variables and/or system properties contain different paths to the SDK.
[Tue Nov 14 15:28:55 UTC 2023][FINE] [SUB] Please correct and use only one way to inject the SDK location.
[Tue Nov 14 15:28:55 UTC 2023][FINE] [SUB]
[Tue Nov 14 15:28:55 UTC 2023][FINE] [SUB] ANDROID_HOME: /home/runner/.gluon/substrate/Android
[Tue Nov 14 15:28:55 UTC 2023][FINE] [SUB] ANDROID_SDK_ROOT: /usr/local/lib/android/sdk
[Tue Nov 14 15:28:55 UTC 2023][FINE] [SUB]
[Tue Nov 14 15:28:55 UTC 2023][FINE] [SUB] It is recommended to use ANDROID_HOME as other methods are deprecated
It works when the environment variable is manually set to be the same:
- name: Build & Package Mobile Binary
env: # overwrite the deprecated SDK_ROOT variable on github runners
ANDROID_SDK_ROOT: /home/runner/.gluon/substrate/Android
ANDROID_HOME: /home/runner/.gluon/substrate/Android
run: mvn gluonfx:build gluonfx:package -Pandroid