react-native: Unable to run any Example project [Android]

Hi,

I am trying to run the UIExplorer project on Ubuntu 14.04. I am getting the following error- Execution failed for task ‘:ReactAndroid:buildReactNdkLib’. Process ‘command ‘/home/bozzmob/android-ndk-r10e/ndk-build’’ finished with non-zero exit value 2

root@purvotara:~/ReactJS/native/react-native# ./gradlew :Examples:UIExplorer:android:app:installDebug . . . :ReactAndroid:buildReactNdkLib make: Entering directory /home/bozzmob/ReactJS/native/react-native/ReactAndroid/src/main/jni/react/jni' . . . make: *** [/home/bozzmob/ReactJS/native/react-native/ReactAndroid/build/react-ndk/all/armeabi-v7a/libgnustl_shared.so] Error 1 make: *** Deleting file/home/bozzmob/ReactJS/native/react-native/ReactAndroid/build/react-ndk/all/armeabi-v7a/libgnustl_shared.so’ make: *** Waiting for unfinished jobs… make: Leaving directory `/home/bozzmob/ReactJS/native/react-native/ReactAndroid/src/main/jni/react/jni’ :ReactAndroid:buildReactNdkLib FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:ReactAndroid:buildReactNdkLib’.

    Process ‘command ‘/home/bozzmob/android-ndk-r10e/ndk-build’’ finished with non-zero exit value 2

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 34.069 secs

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 31 (14 by maintainers)

Most upvoted comments

Install android-ndk-r10e rather than android-ndk(r11 by default)

brew uninstall android-ndk
brew install android-ndk-r10e

And add ANDROID_NDK_HOME in your ~/.bash_profile

export ANDROID_NDK_HOME=/usr/local/opt/android-ndk-r10e

Then

./gradlew :Examples:UIExplorer:android:app:installDebug
./packager/packager.sh

Changing the version of NDK worked for me. stack overflow

# android-ndk-r10e repalace the old version it works Thank you

Solved it at Stack Overflow. Closing this issue. Thanks @sailei1 @yipengmu and @ide for your responses and contributions, I could solve initial issues here right away 👍