Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android NDK, Error:(165, 0) Cause: ndk-build binary cannot be found

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

like image 379
han4wluc Avatar asked Oct 22 '15 14:10

han4wluc


People also ask

How do I update NDK?

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.

How do I know if NDK is installed?

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.

Where is the NDK folder located?

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.


2 Answers

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

like image 118
Athman Avatar answered Nov 07 '22 03:11

Athman


Try copying your local.properties file in the top level directory of your react-native checkout.

like image 33
The Dirty Calvinist Avatar answered Nov 07 '22 02:11

The Dirty Calvinist