React Native UIExplorer构建失败的android

时间:2016-03-18 12:26:31

标签: android reactjs android-ndk react-native native

我无法从android的官方回购中构建UIExplorer示例。

我完全按照Github to the example中的步骤进行操作 我使用android-ndk-r9b

所以当我运行命令时:

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

出现以下内容:

 ./gradlew :Examples:Movies:android:app:installDebug                
:ReactAndroid:preBuild UP-TO-DATE
:ReactAndroid:preReleaseBuild UP-TO-DATE
:ReactAndroid:compileReleaseNdk UP-TO-DATE
:ReactAndroid:compileLint
:ReactAndroid:copyReleaseLint UP-TO-DATE
:ReactAndroid:checkReleaseManifest
:ReactAndroid:preDebugAndroidTestBuild UP-TO-DATE
:ReactAndroid:preDebugBuild UP-TO-DATE
:ReactAndroid:preDebugUnitTestBuild UP-TO-DATE
:ReactAndroid:preReleaseUnitTestBuild UP-TO-DATE
:ReactAndroid:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:ReactAndroid:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:ReactAndroid:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:ReactAndroid:prepareComFacebookFrescoDrawee081Library UP-TO-DATE
:ReactAndroid:prepareComFacebookFrescoFbcore081Library UP-TO-DATE
:ReactAndroid:prepareComFacebookFrescoFresco081Library UP-TO-DATE
:ReactAndroid:prepareComFacebookFrescoImagepipeline081Library UP-TO-DATE
:ReactAndroid:prepareComFacebookFrescoImagepipelineOkhttp081Library UP-TO-DATE
:ReactAndroid:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:ReactAndroid:prepareReleaseDependencies
:ReactAndroid:compileReleaseAidl UP-TO-DATE
:ReactAndroid:compileReleaseRenderscript UP-TO-DATE
:ReactAndroid:generateReleaseBuildConfig UP-TO-DATE
:ReactAndroid:generateReleaseAssets UP-TO-DATE
:ReactAndroid:mergeReleaseAssets UP-TO-DATE
:ReactAndroid:generateReleaseResValues UP-TO-DATE
:ReactAndroid:generateReleaseResources UP-TO-DATE
:ReactAndroid:mergeReleaseResources UP-TO-DATE
:ReactAndroid:processReleaseManifest UP-TO-DATE
:ReactAndroid:processReleaseResources UP-TO-DATE
:ReactAndroid:generateReleaseSources UP-TO-DATE
:ReactAndroid:createNativeDepsDirectories UP-TO-DATE
:ReactAndroid:downloadBoost UP-TO-DATE
:ReactAndroid:prepareBoost UP-TO-DATE
:ReactAndroid:downloadDoubleConversion UP-TO-DATE
:ReactAndroid:prepareDoubleConversion UP-TO-DATE
:ReactAndroid:downloadFolly UP-TO-DATE
:ReactAndroid:prepareFolly UP-TO-DATE
:ReactAndroid:downloadGlog UP-TO-DATE
:ReactAndroid:prepareGlog UP-TO-DATE
:ReactAndroid:downloadJSCHeaders UP-TO-DATE
:ReactAndroid:prepareJSC
:ReactAndroid:buildReactNdkLib
Android NDK: WARNING:/Users/chris/Documents/react-native/ReactAndroid/src/main/jni//react/Android.mk:reactnative: LOCAL_LDLIBS is always ignored for static libraries    
Android NDK: WARNING:/Users/chris/Documents/react-native/ReactAndroid/src/main/jni//react/Android.mk:reactnative: LOCAL_LDLIBS is always ignored for static libraries    
make: Entering directory `/Users/chris/Documents/react-native/ReactAndroid/src/main/jni/react/jni'
[armeabi-v7a] Compile++ thumb: reactnativejni <= JSCPerfLogging.cpp
[armeabi-v7a] Compile++ thumb: reactnativejni <= JSLogging.cpp
[armeabi-v7a] Compile++ thumb: reactnativejni <= OnLoad.cpp
[armeabi-v7a] Compile++ thumb: reactnativejni <= ProxyExecutor.cpp
[armeabi-v7a] SharedLibrary  : libglog.so
[armeabi-v7a] SharedLibrary  : libfb.so
[armeabi-v7a] StaticLibrary  : libdouble-conversion.a
[armeabi-v7a] Prebuilt       : libjsc.so <= /Users/chris/Documents/react-native/ReactAndroid/build/third-party-ndk/jsc/jni/armeabi-v7a/
[armeabi-v7a] Compile++ thumb: reactnative <= Bridge.cpp
[armeabi-v7a] Compile++ thumb: reactnative <= JSCExecutor.cpp
[armeabi-v7a] Compile++ thumb: reactnative <= JSCHelpers.cpp
/Users/chris/Documents/react-native/ReactAndroid/src/main/jni//react/JSCExecutor.cpp: In function 'const OpaqueJSValue* facebook::react::nativePerformanceNow(JSContextRef, JSObjectRef, JSObjectRef, size_t, const OpaqueJSValue* const*, const OpaqueJSValue**)':
/Users/chris/Documents/react-native/ReactAndroid/src/main/jni//react/JSCExecutor.cpp:630:17: error: 'CLOCK_MONOTONIC_RAW' was not declared in this scope
   clock_gettime(CLOCK_MONOTONIC_RAW, &now);
                 ^
make: *** [/Users/chris/Documents/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/reactnative/JSCExecutor.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/Users/chris/Documents/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 '/Users/chris/Documents/android-ndk-r9b/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: 17.519 secs

我可以看到错误消息:

error: 'CLOCK_MONOTONIC_RAW' was not declared in this scope

但我没有解决问题的线索

1 个答案:

答案 0 :(得分:0)

我使用r10e的NDK,然后问题解决了