Go mobile(一)

来源:互联网 发布:搜狗搜索sem优化师 编辑:程序博客网 时间:2024/06/05 04:42

编译环境

  • 在GOPATH/src下执行 gomobile build -target=android golang.org/x/mobile/example/basic,会产生如下报错:
    gomobilebuild

  • 根据报错得知,我们只需要通过gomobile init -ndk <ndk_path>设置NDK路径即可。

    • 执行 gomobile init -ndk D:\Android\sdk\ndk-bundle

编译APK

  • 再次在GOPATH/src下执行 gomobile build -target=android golang.org/x/mobile/example/basic,会在GOPATH/src下生成 basic.apk
原创粉丝点击