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 not work #28449

Closed
blue-bird1 opened this issue Oct 28, 2018 · 8 comments

Comments

Projects
None yet
5 participants
@blue-bird1
Copy link

commented Oct 28, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.11.1 linux/amd64

Does this issue reproduce with the latest release?

yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build759758858=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://github.com/golang/go/wiki/Mobile

go get golang.org/x/mobile/cmd/gomobile
gomobile init   # 1 second stop
go get -d golang.org/x/mobile/example/basic
gomobile build -target=android golang.org/x/mobile/example/basic

What did you expect to see?

Compiled successfully

What did you see instead?

init Done, build took 0s.
output gomobile: no Android NDK path is set. Please run gomobile init with the ndk-bundle installed through the Android SDK manager or with the -ndk flag set.

@gopherbot gopherbot added this to the Unreleased milestone Oct 28, 2018

@gopherbot gopherbot added the mobile label Oct 28, 2018

@blue-bird1

This comment has been minimized.

Copy link
Author

commented Oct 28, 2018

sorry,i error think this is auto tool

@blue-bird1 blue-bird1 closed this Oct 28, 2018

@katcipis

This comment has been minimized.

Copy link

commented Jan 6, 2019

@blue-bird1 I'm having the exact same problem (same go version also), gomobile init does not seem to be doing anything (I supposed it should install NDK, but it does nothing..silently). Why has this issue been closed ? Did you manage to find out how to get gomobile init to work ?

@blue-bird1

This comment has been minimized.

Copy link
Author

commented Jan 6, 2019

@blue-bird1 I'm having the exact same problem (same go version also), gomobile init does not seem to be doing anything (I supposed it should install NDK, but it does nothing..silently). Why has this issue been closed ? Did you manage to find out how to get gomobile init to work ?

If you don't set up the environment, it won't work, and it won't report any errors. I thought it was because I didn't set up the environment, so shut it down. You just need to install ndk and set environment var to make it work.

@katcipis

This comment has been minimized.

Copy link

commented Jan 6, 2019

Them the docs and the help of gomobile should be updated, they indicate that the environment will be built for you automatically. On the help it seems explicit that the NDK will be installed for you:

init        install NDK toolchains and build OpenAL for Android

The wiki even says that it may take minutes (instead it exits immediately and seems to do nothing).

@dolanor

This comment has been minimized.

Copy link

commented Jan 8, 2019

same problem here too. What's the solution? Set some env var? Which one? The wiki doesn't really explain it well. It should be updated.

@katcipis

This comment has been minimized.

Copy link

commented Jan 8, 2019

@dolanor I ended up not doing any mobile stuff, but I think the gomobile init is not working anymore, so you need to install the NDK manually on some dir and then pass the dir as a parameter to init:

gomobile init -ndk <dir>

The help mentions the ANDROID_HOME env var:

➜  ~ % gomobile init -help
usage: gomobile init [-ndk dir] [-openal dir]

If the -ndk flag is specified or the Android NDK is installed at
$ANDROID_HOME/ndk-bundle, init will create NDK standalone toolchains
for Android targets.

If a OpenAL source directory is specified with -openal, init will
build an Android version of OpenAL for use with gomobile build
and gomobile install.
@katcipis

This comment has been minimized.

Copy link

commented Jan 8, 2019

Not working in the sense that it does not install the NDK for you...perhaps other stuff still works =)

@C-ollins

This comment has been minimized.

Copy link

commented Mar 2, 2019

My travis ci fails now and was passing before. My ndk path is set correctly but it's asking for openal. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.