Skip to content
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

Android builds fail on GH ubuntu-22.04 runners due to conflicting SDK variables #1237

Open
ennerf opened this issue Nov 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ennerf
Copy link
Contributor

ennerf commented Nov 14, 2023

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
@ennerf ennerf added the bug Something isn't working label Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant