Gomobile binding fails

Hello, I’m very new to go.
I want to get an aar from my go package
I did:

PS C:\Users\Cyber\a> go install golang.org/x/mobile/cmd/gobind@latest
PS C:\Users\Cyber\a> gomobile bind -target=android github.com/Cyberavater/goPlay
C:\Users\Cyber\go\bin\gomobile.exe: C:\Users\Cyber\go\bin\gobind.exe -lang=go,java -outdir=C:\Users\Cyber\AppData\Local\Temp\gomobile-work-696101797 github.com/Cyberavater/goPlay failed: exit status 1
no exported names in the package "github.com/Cyberavater/goPlay"
unable to import bind: no Go package in golang.org/x/mobile/bind
unable to import bind: no Go package in golang.org/x/mobile/bind
no exported names in the package "github.com/Cyberavater/goPlay"
no exported names in the package "github.com/Cyberavater/goPlay"
no exported names in the package "github.com/Cyberavater/goPlay"
"golang.org/x/mobile/bind" is not found; run go get golang.org/x/mobile/bind: no Go package in golang.org/x/mobile/bind

Keep in mind that I only installed Go in Windows (NDK already installed) and nothing more.
Please explain as detailed as possible.

PS C:\Users\Cyber\a> go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Cyber\AppData\Local\go-build
set GOENV=C:\Users\Cyber\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Cyber\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Cyber\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.21.1
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=NUL
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\Cyber\AppData\Local\Temp\go-build710553425=/tmp/go-build -gno-record-gcc-switches

I tried to run this locally, but I don’t have the Android Sdk installed yet. Have you tried running gomobile init before gomobile bind?

Yes, I did that.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.