Downloaded from GitHub, to make moudle 'ReactAndroid', then:
Error:(687) Android NDK: Module reactnativejnifb depends on undefined modules: fbjni
Error:(700) *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)
Error:Execution failed for task ':ReactAndroid:buildReactNdkLib'.
Process 'command '/Users/sumomokawaakira/Downloads/adt-bundle-mac-x86_64/sdk/ndk-bundle/ndk-build'' finished with non-zero exit value 2
I had this problem too. I think you can fix it by making sure you are using the precisely correct version of the Android NDK (android-ndk-r10e
).
Also make sure that you set the environment variables and stuff done right.
(For what it's worth I'm stuck on later steps, but hopefully this should help you get passed this particular issue)
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
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