I'm trying to produce aar file by run command gomobile bind as per below :
gomobile bind -target=android golang.org/x/mobile/example/bind/hello
But always, getting error like below :
gomobile: gobind -lang=go,java -outdir=/var/folders/s_/yzvdrlg522z237w58tjn2rm00000gp/T/gomobile-work-931510225 golang.org/x/mobile/example/bind/hello failed: exec: "gobind": executable file not found in $PATH
I already tried to specified path inside class GobindExtension in GobindPlugin.groovy as per below:
class GobindExtension {
// Package to bind. Separate multiple packages with spaces. (required)
def String pkg = "golang.org/x/mobile/example/bind/hello"
// GOPATH: necessary for gomobile tool. (required)
def String GOPATH = System.getenv("GOPATH")
// GO: path to go tool. (can omit if 'go' is in the paths visible by Android Studio)
def String GO = "/usr/local/opt/go/libexec/bin"
// GOMOBILE: path to gomobile binary. (can omit if 'gomobile' is under GOPATH)
def String GOMOBILE = "/Users/vierdamila1/Desktop/go-workspace/bin/gomobile"
}
And this is my GOPATH :
export GOPATH="/Users/vierdamila1/Desktop/go-workspace"
But still not working. Did I missed something here? Really appreciate for any kind help.