1. 安装Go语言SDK

  https://www.golangtc.com/download

2. 配置系统变量这建立GOROOT和GOPATH两个目录,分别对应sdk所在目录与项目文件根目录

3.  输入go version 验证是否成功

4. 安装gomobile

  1)cmd敲起命令(需要CMD翻墙)

  

go get golang.org/x/mobile/cmd/gomobile
gomobile init

  2)git clone https://github.com/golang/mobile,下载成功后改文件名为mobile, copy到$GOPATH/src/golang.org/x/

    如果没有文件路径,自行创建

  2.1)go build golang.org/x/mobile/cmd/gomobile,此时会在GOPATH/bin下面生成gomobile;

  2.2)执行gomobile init, 会在GOPATH/bin下面生成gobind;

gomobile init执行不会报错,如果有问题,执行bind时会报错;

执行init后,执行gomobile version,查看是否成功:

  将gomobile,gobind拷贝, sudo cp gomobile gobind /usr/local/go/bin;因为执行gomobile bind时,回去系统path里找gobind;

  下载:AndroidNDK

  1. 选择符合的操作系统及位数的NDK包:https://developer.android.google.cn/ndk/downloads/index.html
  2. 解压,放到一个你记得住的目录

  3) 尝试编译第一个Android apk安装包cmd命令:gomobile build -target=android golang.org/x/mobile/example/basic

 如果提示 “No android NDK path is set“,需要以下代码指定NDK路径

  
gomobile init -ndk "你的AndroidNDK路径"

  然后再编译,编译成功后会把编译后的APK(%GOPATH%\src)安装包放到CMD当前指向的目录中

  


最新文章

  1. Thinkphp源码分析系列(三)– App应用程序类
  2. 60-chmod 修改文件的权限
  3. 118. Pascal's Triangle
  4. 【BZOJ】3240: [Noi2013]矩阵游戏
  5. 为Windows 8新建工具栏模拟“开始菜单”
  6. hdu 4712 Hamming Distance 随机
  7. vs2012 Silverlight项目签名报错异常的处理方式
  8. BestCoder Round #75 解题报告
  9. python之数据库操作(sqlite)
  10. Arch安装详解
  11. 关于iOS开发中info.plist文件的解读
  12. WebService之CXF注解之四(测试类)
  13. 洛谷1196【NOI2002】题解
  14. Linux报错之ping: www.baidu.com: Name or service not known
  15. c#NPOI读取excel 比interop和Microsoft.Jet.OLEDB.4.0 之类 的好的多
  16. Linux 命令详解(七)Systemd 入门教程:命令篇
  17. 封装sqlhelper【一】
  18. UVa 11039 - Building designing 贪心,水题 难度: 0
  19. 关于hive的优化
  20. POJ 3468A Simple Problem with Integers(线段树区间更新)

热门文章

  1. lvm的一些特殊命令
  2. Jenkins+gitlab+msbuild
  3. MyBatis参数条件查询传入的值为0时的判断
  4. Python之路【第二十六篇】:HTTP协议
  5. Go基础编程实践(八)—— 系统编程
  6. sublime_python编译_输出台中文为乱码
  7. CapsLock Enhancement via AutoHotKey
  8. 全栈项目|小书架|服务器端-NodeJS+Koa2 实现评论功能
  9. PHP的序列化、对象、反射、异常与错误
  10. java之spring mvc之页面跳转