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: claims to require 1.7+ but actually requires 1.9+ #29486

AxbB36 opened this issue Dec 31, 2018 · 1 comment

x/mobile: claims to require 1.7+ but actually requires 1.9+ #29486

AxbB36 opened this issue Dec 31, 2018 · 1 comment


Copy link

@AxbB36 AxbB36 commented Dec 31, 2018

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

$ go version
go version go1.7.4 linux/amd64

Does this issue reproduce with the latest release?

The latest release of go: no.
The latest release of x/mobile: yes.

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

go env Output
$ go env
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build021626937=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I was following the instructions at

I'm using Go 1.7.4. gomobile says that it requires Go 1.7+:

$ gomobile
Gomobile is a tool for building and running mobile apps written in Go.

To install:
        $ go get
        $ gomobile init

At least Go 1.7 is required.

I got as far as the gomobile bind command.

$ gomobile bind -o app/hello.aar -target=android

What did you expect to see?

$ gomobile bind -o app/hello.aar -target=android

(no error)

What did you see instead?

A segmentation fault:

$ gomobile bind -o app/hello.aar -target=android
gomobile: /home/user/go/bin/gobind -lang=go,java -outdir=/tmp/gomobile-work-966862185 failed: exit status 2
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x4066ec]

goroutine 1 [running]:
panic(0x6e4220, 0xc4200100b0)
        /usr/lib/go-1.7/src/runtime/panic.go:500 +0x1a1
        /home/user/go/src/ +0x9ac
        /home/user/go/src/ +0x27

Additional information

gobind uses an interface that's only in Go 1.9+. I traced the error to this line added by this commit:

	imp := importer.For("source", nil)

importer.For is returning nil. Support for the "source" argument was added in f81466c. I didn't find the change in the release notes, but git tag --contains f81466ce9c663ddc1d136d2c435c60d988cf316a indicates it was added in go1.9. I tried it again with go1.10.5 and didn't encounter the problem.

Copy link

@gopherbot gopherbot commented Jan 3, 2019

Change mentions this issue: cmd/gomobile: bump required Go version to 1.10

@golang golang locked and limited conversation to collaborators Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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