Failed to run ANY native example response

I am trying to run a UIExplorer project on Ubuntu 14.04. I installed the SDK and NDK. I can run normal native responsive projects (the one I create), but not Examples from the official repo .

export ANDROID_NDK=/home/bozzmob/android-ndk-r10e/ 

I get the following error:

Execution failed for task ': ReactAndroid: buildReactNdkLib'.

"command" / home / bozzmob / android -ndk-r10e / ndk-build '' completed with nonzero output value 2

Magazines look like

 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' [armeabi-v7a] Compile++ thumb: reactnativejni <= OnLoad.cpp [armeabi-v7a] SharedLibrary : libfb.so [armeabi-v7a] SharedLibrary : libglog.so [armeabi-v7a] StaticLibrary : libdouble-conversion.a BFD: /home/bozzmob/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-> androideabi/4.8/liblto_plugin.so: file too short BFD: /home/bozzmob/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.8/liblto_plugin.so: file too short BFD: /home/bozzmob/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.8/liblto_plugin.so: file too short BFD: /home/bozzmob/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.8/liblto_plugin.so: file too short BFD: /home/bozzmob/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.8/liblto_plugin.so: file too short BFD: /home/bozzmob/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.8/liblto_plugin.so: file too short BFD: /home/bozzmob/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.8/liblto_plugin.so: file too short BFD: /home/bozzmob/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.8/liblto_plugin.so: file too short [armeabi-v7a] Prebuilt : libjsc.so <= /home/bozzmob/ReactJS/native/react-native/ReactAndroid/build/third-party-ndk/jsc/jni/armeabi-v7a/ [armeabi-v7a] Compile++ thumb: reactnative <= Bridge.cpp [armeabi-v7a] Compile++ thumb: reactnative <= Value.cpp [armeabi-v7a] Compile++ thumb: reactnative <= JSCHelpers.cpp [armeabi-v7a] Compile++ thumb: reactnative <= JSCExecutor.cpp [armeabi-v7a] Install : libjsc.so => /home/bozzmob/ReactJS/native/react-native/ReactAndroid/build/react-ndk/all/armeabi-v7a/libjsc.so [armeabi-v7a] Install : libgnustl_shared.so => /home/bozzmob/ReactJS/native/react-native/ReactAndroid/build/react-ndk/all/armeabi-v7a/libgnustl_shared.so 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 

Please let me know what I am doing wrong?

+7
performance android reactjs android-ndk react-native
source share
2 answers

It looks like you have problems compiling native (C ++) response sources to your own android. To start a new project, you do not need to do this (NDK configuration is not required), and therefore you can just try creating a sample project using react-native init (see this for instructions). After that, you can simply copy the sample application JS files into your newly created project.

If you still want to create the infrastructure code from the source code, I will need additional information to help you. I would suggest enabling verbose mode for ndk-build, after which you can return here with the exit. To enable verbose mode, you will need to modify this file: ReactAndroid / build.gradle and add 'V=1' to args so that the code fragment I linked to looks like this:

  commandLine getNdkBuildFullPath(), 'NDK_PROJECT_PATH=null', 'V=1', "NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk", 'NDK_OUT=' + temporaryDir, 
+1
source share

I also ran into the same build error and found a solution from this post. You should use Android NDK r10e instead of the last (r11).

0
source share

All Articles