我试图在给出示例(https://godoc.org/golang.org/x/mobile/example
)的情况下测试golang移动包,但不幸的是我遇到了一些错误:
C:\Users\D\Documents\gocode\src\golang.org\x\mobile\example\flappy>go run main.go
# golang.org/x/mobile/gl
..\..\gl\gl.go:1683: undefined: context3
..\..\gl\gl.go:1695: undefined: context3
..\..\gl\gl.go:1707: undefined: context3
..\..\gl\gl.go:1719: undefined: context3
..\..\gl\gl.go:1731: undefined: context3
..\..\gl\gl.go:1743: undefined: context3
..\..\gl\gl.go:1755: undefined: context3
..\..\gl\gl.go:1773: undefined: context3
..\..\gl\gl.go:1783: undefined: context3
..\..\gl\gl.go:1794: undefined: context3
..\..\gl\gl.go:1794: too many errors
对于移动包安装,我只编写了go get golang.org/x/mobile
命令,我正在使用go1.6.2 windows/amd64
go版本。
答案 0 :(得分:1)
如果你想生成apk进行测试,你应该运行以下命令:
gomobile build -target=android golang.org/x/mobile/example/flappy
可以找到更多信息here