gomobile build

Posted 风语者

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gomobile build相关的知识,希望对你有一定的参考价值。

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

以上是关于gomobile build的主要内容,如果未能解决你的问题,请参考以下文章