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 init fails to download ndk on x86 host #18522

Closed
mvasl opened this issue Jan 5, 2017 · 5 comments
Closed

x/mobile: gomobile init fails to download ndk on x86 host #18522

mvasl opened this issue Jan 5, 2017 · 5 comments

Comments

@mvasl
Copy link

mvasl commented Jan 5, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.7.4 linux/386

What operating system and processor architecture are you using (go env)?

GOARCH="386"
GOBIN=""
GOEXE=""
GOHOSTARCH="386"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/max/dev/workspace/go"
GORACE=""
GOROOT="/home/max/dev/go"
GOTOOLDIR="/home/max/dev/go/pkg/tool/linux_386"
CC="gcc"
GOGCCFLAGS="-fPIC -m32 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build501597397=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

What did you do?

I'm trying to install gomobile using https://github.com/golang/go/wiki/Mobile as a manual.
Running (gomobile init) ends up with error message:
"gomobile: error fetching https://dl.google.com/go/mobile/gomobile-ndk-r12b-linux-x86.tar.gz, status: 404 Not Found"

Looks like it just can't find proper ndk to download. Is there any known fix or workaround for this?

@mvasl mvasl changed the title x/mobile: x/mobile: gomobile fails to download ndk on x86 host Jan 5, 2017
@mvasl mvasl changed the title x/mobile: gomobile fails to download ndk on x86 host x/mobile: gomobile init fails to download ndk on x86 host Jan 5, 2017
@bradfitz bradfitz added this to the Unreleased milestone Jan 5, 2017
@mvdan
Copy link
Member

mvdan commented Jan 5, 2017

To the best of my knowledge, the NDK dropped 32-bit support on Linux quite a few releases ago. They still seem to offer 32-bit builds for Windows, though.

@rakyll
Copy link
Contributor

rakyll commented Jan 5, 2017

32-bit Linux is not supported anymore. We should die with a proper error message saying it is not supported.

@mvasl
Copy link
Author

mvasl commented Jan 5, 2017

@rakyll
No way to get it to work with an outdated ndk for 386?
Something like "linux/386 ndk is outdated and is not supported by gomobile anymore. Use with caution"

@rakyll
Copy link
Contributor

rakyll commented Jan 8, 2017

There is no way to override the NDK location right now, but you should be able to override CC, CXX, CGO_CFLAGS, CGO_CPPFLAGS and CGO_LDFLAGS individually to target an earlier version of NDK toolchain.

@gopherbot
Copy link

CL https://golang.org/cl/35173 mentions this issue.

@golang golang locked and limited conversation to collaborators Jan 17, 2018
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
Gomobile has up until now used stripped NDKs hosted by Google. This
arrangement adds maintenance overhead and blocks the use of custom
NDKs or custom API levels. Also, as noted in issue 16211, the stripped
NDK is no longer tiny because Gomobile supports more platforms.

This CL removed the code for generating and packaging stripped NDKs and
adds support for using external NDKs to the gomobile tool.

gomobile init will now use the NDK installed by the Android SDK manager,
if present, or a user specified NDK if the -ndk flag is given. If no
NDK was found or specified, Android initialization is skipped. gomobile
will instruct the user to run init with a valid NDK if bind or build is
invoked without Android initialization.

gomobile init will also attempt to build OpenAL for Android if the -openal
flag specifies a source directory. It needs cmake and, on Windows, nmake
installed. If gomobile build is run on an app that requires
golang.org/x/mobile/exp/audio/al and OpenAL wasn't built by init, the user
is instructed to do so.

Tested on Linux, macOS, Windows.

Fixes golang/go#16211
Fixes golang/go#18522

Change-Id: Ia38f6e43e671a207dad562678c65225b426e7e3e
Reviewed-on: https://go-review.googlesource.com/35173
Reviewed-by: David Crawshaw <crawshaw@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
Gomobile has up until now used stripped NDKs hosted by Google. This
arrangement adds maintenance overhead and blocks the use of custom
NDKs or custom API levels. Also, as noted in issue 16211, the stripped
NDK is no longer tiny because Gomobile supports more platforms.

This CL removed the code for generating and packaging stripped NDKs and
adds support for using external NDKs to the gomobile tool.

gomobile init will now use the NDK installed by the Android SDK manager,
if present, or a user specified NDK if the -ndk flag is given. If no
NDK was found or specified, Android initialization is skipped. gomobile
will instruct the user to run init with a valid NDK if bind or build is
invoked without Android initialization.

gomobile init will also attempt to build OpenAL for Android if the -openal
flag specifies a source directory. It needs cmake and, on Windows, nmake
installed. If gomobile build is run on an app that requires
golang.org/x/mobile/exp/audio/al and OpenAL wasn't built by init, the user
is instructed to do so.

Tested on Linux, macOS, Windows.

Fixes golang/go#16211
Fixes golang/go#18522

Change-Id: Ia38f6e43e671a207dad562678c65225b426e7e3e
Reviewed-on: https://go-review.googlesource.com/35173
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants