Android NDK,错误:(165,0)原因:找不到ndk-build二进制文件

han*_*luc 12 android-ndk android-studio react-native

我正在尝试使用AndroidStudio运行react-native ReactAndroid项目.但是我得到了这个NDK错误.

Error:(165, 0) Cause: ndk-build binary cannot be found, check if you've set $ANDROID_NDK environment variable correctly or if ndk.dir is setup in local.properties

我从这里下载了android NDK http://developer.android.com/intl/pt-br/ndk/downloads/index.html

echo $ANDROID_NDK/Users/lu/Dev/Android/android-ndk-r10e

在local.properties里面我有: ndk.dir=/Users/username/Dev/Android/android-ndk-r10e

我正在使用Android Studio 1.4

Ath*_*man 19

在Android上运行React Native的UI资源管理器应用程序时出现同样的错误.如果你在Mac上,这对我有用:

$ brew install android-ndk

$ echo 'export ANDROID_NDK_HOME=/usr/local/opt/android-ndk' >> ~/.bash_profile

重启你的终端

确保运行模拟器:

cd react-native
./gradlew :Examples:UIExplorer:android:app:installDebug
./packager/packager.sh
Run Code Online (Sandbox Code Playgroud)

初始构建需要一段时间

  • React native不能与最新的ndk一起使用,我不得不运行"brew install homebrew/versions/android-ndk-r10e"然后"echo'export ANDROID_NDK_HOME =/usr/local/opt/android-ndk-r10e'>>〜 /.bash_profile" (3认同)

The*_*ist 7

尝试将本地.properties文件复制到react-native checkout的顶级目录中.