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 FAILEDFAILURE: 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
@jiangqingbo 我也遇到了,你解决了吗
Changing the version of NDK worked for me. stack overflow
@bozzmob hi ,bozzmob,the same error i met when i try to build the example from the react source code via the docs here. how did u solved the problem? the link u point to stack overflow is 404 now, could u please paste it again? thank you.
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
i got it working by editing local.properties inside react-native directory with
ndk.dir=~/Library/Android/ndk/android-ndk-r10e
@mdluo @bozzmob @satya164 is there any way possible to make this thing work with NDK r12b (which is the latest version) ? i am facing the same issue and i think it needs arm toolchain 4.8 while i have with me 4.9. My log output - https://gist.github.com/vinaynb/13fd43a0d96d30ee0feabe491b7e7c84
@vinaynb I don't think so. is there a reason you can't use r10e?
@satya164 nope no reason i can't use r10e. I'll do it now. I didn't read the docs that RN needs r10e right now and instead straightly downloaded r12b from the downloads page for ndk.
# android-ndk-r10e repalace the old version it works Thank you
android-ndk-r10e, is not working for me , its gives me the error , Error:Execution failed for task ':ReactAndroid:buildReactNdkLib'.
Process 'command 'D:\soft\android-ndk-r10e-windows-x86_64\android-ndk-r10e\ndk-build.cmd'' finished with non-zero exit value 2 I am working on Windows 7 environment.
if you just modify the url you will be able to get to the stack overflow https://stackoverflow.com/questions/33591532/unable-to-run-any-react-native-example-project/33917178 @windylcx