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: No Android NDK found when execute gomobile bind #32518

Closed
diov opened this issue Jun 10, 2019 · 3 comments
Closed

x/mobile: No Android NDK found when execute gomobile bind #32518

diov opened this issue Jun 10, 2019 · 3 comments
Labels
Milestone

Comments

@diov
Copy link

@diov diov commented Jun 10, 2019

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

$ go version
go version go1.12.5 darwin/amd64

Does this issue reproduce with the latest release?

YES

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/dio/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/dio/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.5/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7j/fndqkfrx03l2gfplx1n4g1nm0000gp/T/go-build033656519=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ go get golang.org/x/mobile/cmd/gomobile
$ gomobile init
$ go get golang.org/x/mobile/example/bind/hello
$ gomobile bind -o app/hello.aar -target=android golang.org/x/mobile/example/bind/hello

What did you expect to see?

hello.aar was generated

What did you see instead?

$ gomobile bind -o app/hello.aar -target=android golang.org/x/mobile/example/bind/hello
gomobile: no Android NDK found in $ANDROID_HOME/ndk-bundle nor in $ANDROID_NDK_HOME
@gopherbot gopherbot added this to the Unreleased milestone Jun 10, 2019
@gopherbot gopherbot added the mobile label Jun 10, 2019
@diov

This comment has been minimized.

Copy link
Author

@diov diov commented Jun 10, 2019

I checked some other stuff.

$ gomobile version
gomobile version +6fa95d9 Fri Jun 7 21:45:18 2019 +0000 (android,ios); androidSDK=

$ echo $ANDROID_HOME
/Users/dio/AndroidSDK/sdk

$ echo $ANDROID_NDK_HOME
/Users/dio/AndroidSDK/android-ndk-r19c

Also, I've run go get -u golang.org/x/mobile/cmd/... before gomobile init, and here is the output

$ go get -u -v golang.org/x/mobile/cmd/...
Fetching https://golang.org/x/mobile/cmd/gobind?go-get=1
Parsing meta tags from https://golang.org/x/mobile/cmd/gobind?go-get=1 (status code 200)
get "golang.org/x/mobile/cmd/gobind": found meta tag get.metaImport{Prefix:"golang.org/x/mobile", VCS:"git", RepoRoot:"https://go.googlesource.com/mobile"} at https://golang.org/x/mobile/cmd/gobind?go-get=1
get "golang.org/x/mobile/cmd/gobind": verifying non-authoritative meta tag
Fetching https://golang.org/x/mobile?go-get=1
Parsing meta tags from https://golang.org/x/mobile?go-get=1 (status code 200)
golang.org/x/mobile (download)
Fetching https://golang.org/x/mobile/bind?go-get=1
Parsing meta tags from https://golang.org/x/mobile/bind?go-get=1 (status code 200)
get "golang.org/x/mobile/bind": found meta tag get.metaImport{Prefix:"golang.org/x/mobile", VCS:"git", RepoRoot:"https://go.googlesource.com/mobile"} at https://golang.org/x/mobile/bind?go-get=1
get "golang.org/x/mobile/bind": verifying non-authoritative meta tag
Fetching https://golang.org/x/mobile/internal/importers?go-get=1
Parsing meta tags from https://golang.org/x/mobile/internal/importers?go-get=1 (status code 200)
get "golang.org/x/mobile/internal/importers": found meta tag get.metaImport{Prefix:"golang.org/x/mobile", VCS:"git", RepoRoot:"https://go.googlesource.com/mobile"} at https://golang.org/x/mobile/internal/importers?go-get=1
get "golang.org/x/mobile/internal/importers": verifying non-authoritative meta tag
Fetching https://golang.org/x/mobile/internal/importers/java?go-get=1
Parsing meta tags from https://golang.org/x/mobile/internal/importers/java?go-get=1 (status code 200)
get "golang.org/x/mobile/internal/importers/java": found meta tag get.metaImport{Prefix:"golang.org/x/mobile", VCS:"git", RepoRoot:"https://go.googlesource.com/mobile"} at https://golang.org/x/mobile/internal/importers/java?go-get=1
get "golang.org/x/mobile/internal/importers/java": verifying non-authoritative meta tag
Fetching https://golang.org/x/mobile/internal/importers/objc?go-get=1
Parsing meta tags from https://golang.org/x/mobile/internal/importers/objc?go-get=1 (status code 200)
get "golang.org/x/mobile/internal/importers/objc": found meta tag get.metaImport{Prefix:"golang.org/x/mobile", VCS:"git", RepoRoot:"https://go.googlesource.com/mobile"} at https://golang.org/x/mobile/internal/importers/objc?go-get=1
get "golang.org/x/mobile/internal/importers/objc": verifying non-authoritative meta tag
Fetching https://golang.org/x/mobile/cmd/gomobile?go-get=1
Parsing meta tags from https://golang.org/x/mobile/cmd/gomobile?go-get=1 (status code 200)
get "golang.org/x/mobile/cmd/gomobile": found meta tag get.metaImport{Prefix:"golang.org/x/mobile", VCS:"git", RepoRoot:"https://go.googlesource.com/mobile"} at https://golang.org/x/mobile/cmd/gomobile?go-get=1
get "golang.org/x/mobile/cmd/gomobile": verifying non-authoritative meta tag
Fetching https://golang.org/x/mobile/internal/binres?go-get=1
Parsing meta tags from https://golang.org/x/mobile/internal/binres?go-get=1 (status code 200)
get "golang.org/x/mobile/internal/binres": found meta tag get.metaImport{Prefix:"golang.org/x/mobile", VCS:"git", RepoRoot:"https://go.googlesource.com/mobile"} at https://golang.org/x/mobile/internal/binres?go-get=1
get "golang.org/x/mobile/internal/binres": verifying non-authoritative meta tag

Still not work.

@diov diov changed the title x/mobile: Missing Android NDK x/mobile: No Android NDK found when execute gomobile bind Jun 10, 2019
@diov

This comment has been minimized.

Copy link
Author

@diov diov commented Jun 11, 2019

It seems like Gomobile didn't detect android SDK, 'cause the output is "androidSDK=" when run gomobile version.
After re-download SDK platform package, it works correctly. So I will close this issue.

@diov diov closed this Jun 11, 2019
@huangweitong

This comment has been minimized.

Copy link

@huangweitong huangweitong commented Jul 13, 2019

Hello, I hava the same problem now, could you tell me how you solved it? Thank you!

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