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: Cannot bind gomobile with simple go package #30842

Closed
karvar opened this Issue Mar 14, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@karvar
Copy link

karvar commented Mar 14, 2019

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

$ go version
go1.10 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/nima/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/nima/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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/7m/96n048px76l_ppk4tz3x6fjm0000gn/T/go-build130059806=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ go get golang.org/x/mobile/cmd/gomobile
$ gomobile init
Created a hello.go file from: https://medium.com/@AndroidAdvance/running-go-from-android-ios-tutorial-7f1d456c5b0f
$ gomobile bind -target=ios .

What did you expect to see?

A generated .framework or .aar file

What did you see instead?

This error:

GOMOBILE=/Users/nima/go/pkg/gomobile
WORK=/var/folders/7m/96n048px76l_ppk4tz3x6fjm0000gn/T/gomobile-work-933094173
GOOS=darwin CGO_ENABLED=1 $GOPATH/bin/gobind -lang=go,objc -outdir=$WORK -tags=ios .
GOARM=7 GOOS=darwin GOARCH=arm CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -miphoneos-version-min=7.0 -arch armv7 CGO_CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -miphoneos-version-min=7.0 -arch armv7 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -miphoneos-version-min=7.0 -arch armv7 CGO_ENABLED=1 GOPATH=$WORK:$GOPATH go build -tags ios -v -x -work -buildmode=c-archive -o $WORK/src-arm.a gobind
WORK=/var/folders/7m/96n048px76l_ppk4tz3x6fjm0000gn/T/gomobile-work-933094173/go-build988785279
/var/folders/7m/96n048px76l_ppk4tz3x6fjm0000gn/T/gomobile-work-933094173/src/gobind/go_srcmain.go:17:2: local import "." in non-local package
WORK=/var/folders/7m/96n048px76l_ppk4tz3x6fjm0000gn/T/gomobile-work-933094173
gomobile: darwin-arm: go build -tags ios -v -x -work -buildmode=c-archive -o /var/folders/7m/96n048px76l_ppk4tz3x6fjm0000gn/T/gomobile-work-933094173/src-arm.a gobind failed: exit status 1

@gopherbot gopherbot added this to the Unreleased milestone Mar 14, 2019

@gopherbot gopherbot added the mobile label Mar 14, 2019

@karvar

This comment has been minimized.

Copy link
Author

karvar commented Mar 21, 2019

Issue was with having the right binaries in my GOPATH

@karvar karvar closed this Mar 21, 2019

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.