linux安装android NDK

http://blog.chinaunix.net/uid-20680966-id-4961541.html


编译JNI,如果没有NDK,会出错
Error:Execution failed for task ':app:compileDebugNdk'.
> NDK not configured.
  Download the NDK from http://developer.android.com/tools/sdk/ndk/.Then add ndk.dir=path/to/ndk in local.properties.
    (On Windows, make sure you escape backslashes, e.g. C:\\ndk rather than C:\ndk)

官网,有墙,最好自己弄个VPN
https://developer.android.com/tools/sdk/ndk/index.html
找到自己平台的下载包,我的
Linux 64-bit (x86)  android-ndk-r10d-linux-x86_64.bin

以下下载地址,直接放到浏览器中下载,不需要VPN
linux 32 bit
http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86.bin
linux 64 bit
http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.bin

Windows 32 bit
http://dl.google.com/android/ndk/android-ndk-r10d-windows-x86.exe
64 bit
http://dl.google.com/android/ndk/android-ndk-r10d-windows-x86_64.exe

Mac OS X 32 bit
http://dl.google.com/android/ndk/android-ndk-r10d-darwin-x86.bin
64 bit
http://dl.google.com/android/ndk/android-ndk-r10d-darwin-x86_64.bin

安装方法:
请确保你已安装了Android SDK
Linux 与Mac OS X (Darwin):
打开终端,进入到你下载包所在的目录
执行chmod a+x 下载包名, 使其可执行,然后执行安装包就行
比如:
ndk$ chmod a+x android-ndk-r10c-darwin-x86_64.bin
ndk$ ./android-ndk-r10c-darwin-x86_64.bin
          
windows安装相对容易,直接双击安装包

假设解压出来的目录在path/to/ndk下
在android studio工程的local.properties文件中加入 ndk.dir=path/to/ndk 
或者设置ANDROID_NDK_HOME环境变量为path/to/ndk  比如在~/.bashrc中加上 export ANDROID_NDK_HOME=/opt/android-ndk-r10d然后重启
作者:帅得不敢出门  程序员群:31843264
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(98) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值