编译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安装相对容易,直接双击安装包