1.从官网下载NDK http://developer.android.com/tools/sdk/ndk/index.html#Reqs ,并解压
文件。(在此目录为/home/zhangz/develop/android-ndk-r8b) 在google官方http://developer.android.com/ndk/downloads/index.html地址下找到对应系统的ndk,我这里是android-ndk-r10e-linux-x86_64.bin 切换到改
文件的下载目录,
修改android-ndk-r10e-linux-x86_64.bin 执行命令: chmod a+x android-ndk-r10c-darwin-x86_64.bin ./android-ndk-r10c-darwin-x86_64.bin
修改系统环境变量 sudo gedit /etc/profile 在profile
文件下面
添加,保存并
退出 export ANDROID_NDK= ndk路径 export PATH=$ANDROID_NDK:$PATH source /etc/profile . /etc/profile 配置好后可通过echo $PATH查看配置环境 输入ndk-build -v,出现一下信息说明ndk配置ok GNU Make 3.81 Copyright (C) 2006 Free Software Foundation,Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for x86_64-pc-linux-gnu profile
文件配置: export PATH=$PATH:/home/opt/Qt5.5.0/5.5/gcc_64/bin:/lbg/arm-tools/bin:/home/lbg/download/gcc-arm-none-eabi-4_9-2015q2/bin:/home/lbg/download/Solaar-0.9.2/bin #export ANDROID_NDK_ROOT=/opt/android/android-ndk-r8e export ANDROID_NDK_ROOT= #/lbg/android/android-ndk-r10 export ANDROID_SDK_ROOT=/lbg/android/android-sdk-linux222 export ANDROID_HOME=$ANDROID_SDK_ROOT export ANDROID_NDK_HOME=$ANDROID_NDK_ROOT export PATH=$PATH:$ANDROID_NDK_ROOT:$ANDROID_SDK_ROOT:$ANDROID_SDK_ROOT/platform-tools:/opt/Qt5.4.0/5.4/gcc_64/bin export JAVA_HOME=/lbg/java/jdk1.7.0_79 export JRE_HOME=$JAVA_HOME/jre export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH export ANDROID_NDK_TOOLCHAIN_ROOT=/lbg/android/android-toolchain export ANDROIDTOOLCHAIN=/lbg/android/android-cmake/android-cmake/toolchain/android.toolchain.cmake alias android-cmake='cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROIDTOOLCHAIN' export GRADLE_HOME=/opt/gradle/gradle-2.10 export PATH=$GRADLE_HOME/bin:$PATH