Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6567149
  • 博文数量: 1159
  • 博客积分: 12444
  • 博客等级: 上将
  • 技术积分: 12570
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-13 21:34
文章分类

全部博文(1159)

文章存档

2016年(126)

2015年(350)

2014年(56)

2013年(91)

2012年(182)

2011年(193)

2010年(138)

2009年(23)

分类: Android平台

2015-07-11 09:51:19

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
/> linux 64 bit
/>
Windows 32 bit
/> 64 bit
/>
Mac OS X 32 bit
/> 64 bit
/>
安装方法:
请确保你已安装了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
阅读(849) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~