gomobile命令错误:“未设置Android NDK路径”

huangapple go评论96阅读模式
英文:

gomobile command error " No android NDK path is set "

问题

我正在使用Windows上的Go版本1.7.5,当我尝试使用gomobile命令进行安装、绑定或构建时,出现以下错误信息:
"gomobile: 未设置Android NDK路径。请通过Android SDK管理器安装ndk-bundle,或使用-ndk标志运行gomobile init。"
我已将NDK路径添加到系统变量$PATH中,甚至手动安装了NDK,但错误仍然存在。
谢谢您的时间!

英文:

I am using Go version 1.7.5 in windows and when i am trying to use gomobile command either to install or bind or build . It displays this error-
"gomobile: no Android NDK path is set. Please run gomobile init with the ndk-bundle installed through the Android SDK manager or with the -ndk flag set."
I have added NDK path to system variable $PATH and even installed NDK manually but still the error persist.
Thanks for your time !!

答案1

得分: 15

你需要在gomobile init命令中使用-ndk标志设置NDK路径-如果你按照这些说明进行操作,路径应该是~/Library/Android/sdk/ndk-bundle/

gomobile init -ndk ~/Library/Android/sdk/ndk-bundle/

然后你可以编译APK:

gomobile build -target=android <PATH>

路径应该相对于$GOPATH/src。例如,如果你安装了基本示例:

go get -d golang.org/x/mobile/example/basic

构建命令应该是:

gomobile build -target=android golang.org/x/mobile/example/basic
英文:

You need to set the NDK path in gomobile init using the -ndk flag - if you follow these instructions, the path should be ~/Library/Android/sdk/ndk-bundle/:

gomobile init -ndk ~/Library/Android/sdk/ndk-bundle/

Then you can compile the APK:

gomobile build -target=android &lt;PATH&gt;

The path should be relative to $GOPATH/src. For example, if you install the basic example:

go get -d golang.org/x/mobile/example/basic

The build command should be:

gomobile build -target=android golang.org/x/mobile/example/basic

huangapple
  • 本文由 发表于 2017年2月24日 12:09:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/42430609.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定