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

x/mobile: gomobile doesn't find Android NDK installed from typical dist pkgs #31461

Closed
quite opened this issue Apr 14, 2019 · 3 comments
Closed
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile
Milestone

Comments

@quite
Copy link

quite commented Apr 14, 2019

On Ubuntu, the google-android-ndk-installer leaves the NDK in /usr/lib/android-ndk, and it seems to be up to the user to set ANDROID_NDK_HOME.

On Arch Linux, the android-ndk package installs the NDK into /opt/android-ndk and sets ANDROID_NDK_HOME to there using an /etc/profile.d/file

There are also other variables, such as ANDROID_NDK, but they seem deprecated. This was somewhat informative: openssl/openssl#8103

@gopherbot gopherbot added this to the Unreleased milestone Apr 14, 2019
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Apr 14, 2019
@gopherbot
Copy link

Change https://golang.org/cl/171938 mentions this issue: cmd/gomobile: look also in $ANDROID_NDK_HOME for the NDK...

@eliasnaur
Copy link
Contributor

One complication is that gomobile build uses tools from the Android SDK. What to do when only ANDROID_NDK_HOME is set?

@quite
Copy link
Author

quite commented Apr 15, 2019

It looks like all code that references ANDROID_HOME (which is where such tools must be picked up) returns error if it can't be found.

And the code that I touch for this issue is only in the ndkRoot() function, so just doing our best there to find the NDK should be enough.

@golang golang locked and limited conversation to collaborators Apr 14, 2020
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
After trying $ANDROID_HOME/ndk-bundle, we also try $ANDROID_NDK_HOME.

ANDROID_NDK_HOME is advised in this NDK sample code wiki:
https://github.com/googlesamples/android-ndk/wiki
Mentioned in the Bazel buildsystem Android app tutorial:
https://docs.bazel.build/versions/master/tutorial/android-app.html

On Ubuntu, the google-android-ndk-installer leaves the NDK in
/usr/lib/android-ndk, and it seems to be up to the user to set
ANDROID_NDK_HOME.

On Arch Linux, the android-ndk package installs the NDK into /opt/android-ndk
and sets ANDROID_NDK_HOME to there using an /etc/profile.d/file

Fixes golang/go#31461

Change-Id: I9f7f7e24b19e0047419f9725b67bd6daf2b1d328
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/171938
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Elias Naur <mail@eliasnaur.com>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
After trying $ANDROID_HOME/ndk-bundle, we also try $ANDROID_NDK_HOME.

ANDROID_NDK_HOME is advised in this NDK sample code wiki:
https://github.com/googlesamples/android-ndk/wiki
Mentioned in the Bazel buildsystem Android app tutorial:
https://docs.bazel.build/versions/master/tutorial/android-app.html

On Ubuntu, the google-android-ndk-installer leaves the NDK in
/usr/lib/android-ndk, and it seems to be up to the user to set
ANDROID_NDK_HOME.

On Arch Linux, the android-ndk package installs the NDK into /opt/android-ndk
and sets ANDROID_NDK_HOME to there using an /etc/profile.d/file

Fixes golang/go#31461

Change-Id: I9f7f7e24b19e0047419f9725b67bd6daf2b1d328
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/171938
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Elias Naur <mail@eliasnaur.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile
Projects
None yet
Development

No branches or pull requests

3 participants