Ask questionsx/mobile: gomobile bind is failing with latest version [+cafc553] of gomobile

<!-- Please answer these questions before submitting your issue. Thanks! -->

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

<pre> $ go version: go1.12.4 linux/amd64

$ go mobile version: gomobile version +cafc553 Mon Aug 26 17:01:11 2019 +0000 (android); androidSDK=/home/--/Android/Sdk/platforms/android-28


Does this issue reproduce with the latest release?

Yes, the issue is produced only on the latest gomobile version.

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

<details><summary><code>go env</code> Output</summary><br><pre> $ go env

GOARCH="amd64" GOBIN="/usr/local/go" GOCACHE="/home/--/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="My Go path" 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-build242944229=/tmp/go-build -gno-record-gcc-switches" </pre></details>

What did you do?

Trying to generate the java binding for my go file: Error:

gomobile bind -o ~/test.aar -target=android -androidapi=23 test || exit 1 gomobile: $GOPATH/bin/gobind -lang=go,java -outdir=/tmp/gomobile-work-628614164 test failed: exit status 1 2019/08/27 09:51:37 go [list -e -json -compiled=true -test=false -export=false -deps=true -find=false -tags -- test]: exit status 2: # runtime/cgo gcc_android.c:6:25: fatal error: android/log.h: No such file or directory compilation terminated.

What did you see instead?

Error in generating the java binding.

Note: Before updating the gomobile same code was building.


Answer questions rayvbr

We're having the same issue (gcc_android.c:6:25: fatal error: android/log.h: No such file or directory) @jay11ca39 initially reported. I can also confirm the problem started once was merged. If I revert that commit, all is well

Edit: note that we're not using Go modules

Github User Rank List