我在 Go[1.12.9 windows/amd64] 中测试 GoMobile 工具,并尝试将其附带的示例项目构建到 Android Apk 中。
在将构建指向包目录并运行构建命令时,控制台给出了一个找不到包错误。如何识别 Go 包?
[注意-我尝试安装和使用GoMobile 工具,但它们也无法识别,我只能通过 VSCode 将它们作为 Git 包下载]
PS D:\Script\Golang\bin> go version
go version go1.12.9 windows/amd64
PS D:\Script\Golang\src\golang.org\x\mobile\example\basic> gci
Directory: D:\Script\Golang\src\golang.org\x\mobile\example\basic
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 18-08-2019 11:27 4618 main.go
-a---- 18-08-2019 11:27 225 main_x.go
PS D:\Script\Golang\src\golang.org\x\mobile\example\basic> cd D:\Script\Golang\bin
PS D:\Script\Golang\bin> .\gomobile.exe build D:\Script\Golang\src\golang.org\x\mobile\example\basic
D:\Script\Golang\bin\gomobile.exe: cannot find package "D:\\Script\\Golang\\src\\golang.org\\x\\mobile\\example\\basic" in any of:
c:\go\src\D:\Script\Golang\src\golang.org\x\mobile\example\basic (from $GOROOT)
D:\Script\Golang\src\D:\Script\Golang\src\golang.org\x\mobile\example\basic (from $GOPATH)
S D:\Script\Golang\bin> .\gomobile.exe build "D:\Script\Golang\src\golang.org\x\mobile\example\basic"
D:\Script\Golang\bin\gomobile.exe: cannot find package "D:\\Script\\Golang\\src\\golang.org\\x\\mobile\\example\\basic" in any of:
c:\go\src\D:\Script\Golang\src\golang.org\x\mobile\example\basic (from $GOROOT)
D:\Script\Golang\src\D:\Script\Golang\src\golang.org\x\mobile\example\basic (from $GOPATH)