You have to change your path to ANDROID_NDK to run gradle command locally.
export ANDROID_NDK=/Users/your_unix_name/android-ndk/android-ndk-r10e
In my case, I put NDK file at /Users/tomo/temp/android-ndk-r10e
so
export ANDROID_NDK=/Users/tomo/temp/android-ndk-r10e
Or if you do not want to change ANDROID_NDK, you can update ReactAndroid/build.gradle
def findNdkBuildFullPath() {
// we allow to provide full path to ndk-build tool
if (hasProperty('ndk.command')) {
return property('ndk.command')
}
// or just a path to the containing directory
if (hasProperty('ndk.dir')) {
def ndkDir = property('ndk.dir')
return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
}
// ** Add below. should be before if (System.getenv('ANDROID_NDK') clause **
Properties properties = new Properties()
properties.load(project.rootProject.file('ReactAndroid/local.properties').newDataInputStream())
if (properties.hasProperty('ndk.dir')) {
def ndkDir = properties.getProperty('ndk.dir')
return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
}
if (System.getenv('ANDROID_NDK') != null) {
def ndkDir = System.getenv('ANDROID_NDK')
return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
}
def ndkDir = android.hasProperty('plugin') ? android.plugin.ndkFolder :
plugins.getPlugin('com.android.library').hasProperty('sdkHandler') ?
plugins.getPlugin('com.android.library').sdkHandler.getNdkFolder() :
android.ndkDirectory.absolutePath
if (ndkDir) {
return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
}
return null
}
then update ReactAndroid/local.properties
ndk.dir=/Users/tomo/temp/android-ndk-r10e
sdk.dir=/Applications/sdk
and Run app from Android Studio