I'm trying to run the react-native ReactAndroid project with AndroidStudio. However I get this NDK error.
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
I have downloaded the android NDK from here http://developer.android.com/intl/pt-br/ndk/downloads/index.html
echo $ANDROID_NDK
gives /Users/lu/Dev/Android/android-ndk-r10e
inside local.properties I have:
ndk.dir=/Users/username/Dev/Android/android-ndk-r10e
I'm using Android Studio 1.4
Go to http://developer.android.com/tools/sdk/ndk/index.html to download the latest version of Android NDK. Unzip the downloaded file. Update <NDK path> from the old NDK path to the newly downloaded and decompressed location.
Open your Android Studio Preference (or "File->Settings") > Appearance & Behavior > System Settings > Android SDK. You can find the path to your SDK and NDK, which is in the same directory.
Android Studio installs all versions of the NDK in the android-sdk /ndk/ directory. Each version is located in a subdirectory with the version number as its name.
I got this same error when running the UI explorer app for React Native on Android. If you are on a Mac here is what worked for me:
$ brew install android-ndk
$ echo 'export ANDROID_NDK_HOME=/usr/local/opt/android-ndk' >> ~/.bash_profile
Restart your terminal
Make sure you have an emulator running then:
cd react-native
./gradlew :Examples:UIExplorer:android:app:installDebug
./packager/packager.sh
The initial build will take sometime
Try copying your local.properties file in the top level directory of your react-native checkout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With