英文:
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 <PATH>
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论