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 binding failed due to lack of some header file in Android NDK #39549

Open
ChronosX88 opened this issue Jun 12, 2020 · 1 comment

Comments

@ChronosX88
Copy link

@ChronosX88 ChronosX88 commented Jun 12, 2020

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

$ go version
go version go1.14.4 linux/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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/chronosx/.cache/go-build"
GOENV="/home/chronosx/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/chronosx/Документы/code/golang/"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/snap/go/5830"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/snap/go/5830/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
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-build278490309=/tmp/go-build -gno-record-gcc-switches"

Android NDK version: 21.3.6528147

Gomobile version: gomobile version +4c31acb Sun Mar 29 12:56:38 2020 +0000 (android); androidSDK=

(I'm tried to use Go from Ubuntu repos, not only from Snap)

What did you do?

I'm trying to build some library which written in Go for Android (build AAR file).

gomobile: go build -tags mobile -ldflags -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildName=yggdrasil -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildVersion=0.3.14 -s -w  -buildmode=c-shared -o=/tmp/gomobile-work-131080533/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind failed: exit status 2
# runtime/cgo
gcc_android.c:6:10: fatal error: 'android/log.h' file not found

The file android/log.h exists in Android NDK.

What did you expect to see?

Library will compile successfully (it was compiled fine before).

What did you see instead?

I got the error:

gcc_android.c:6:10: fatal error: 'android/log.h' file not found
@gopherbot gopherbot added the mobile label Jun 12, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jun 12, 2020
@toothrot
Copy link
Contributor

@toothrot toothrot commented Jun 12, 2020

/cc @hyangah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.