V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
heitao1
V2EX  ›  Android

React Native 编译错误: ReactAndroid:buildReactNdkLib FAILED

  •  
  •   heitao1 · 2016-12-18 11:02:00 +08:00 · 7962 次点击
    这是一个创建于 2901 天前的主题,其中的信息可能已经有所发展或是发生改变。

    错误输出入如下:

    [armeabi-v7a] Compile++      : reactnativejni <= Dummy.cpp
    make: /Users/qisen/adt-bundle/android-ndk-r12b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
    [armeabi-v7a] Compile++      : reactnativejnifb <= CatalystInstanceImpl.cpp
    [armeabi-v7a] Compile++      : reactnativejnifb <= CxxModuleWrapper.cpp
    make: *** [/Users/qisen/tmp/node/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/reactnativejni/Dummy.o] Error 1
    make: *** Waiting for unfinished jobs....
    make: /Users/qisen/adt-bundle/android-ndk-r12b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
    make: /Users/qisen/adt-bundle/android-ndk-r12b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
    make: *** [/Users/qisen/tmp/node/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/reactnativejnifb/CxxModuleWrapper.o] Error 1
    make: *** [/Users/qisen/tmp/node/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/reactnativejnifb/CatalystInstanceImpl.o] Error 1
    :ReactAndroid:buildReactNdkLib FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':ReactAndroid:buildReactNdkLib'.
    > Process 'command '/Users/qisen/adt-bundle/android-ndk-r12b/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: 20.673 secs
    

    原因为 NDK 版本不对,必须 gcc4.8 ,请选择 Android NDK r10e 对应系统下载安装,需要自备梯子:

    http://www.yinqisen.cn/blog-740.html

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3028 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 19ms · UTC 14:40 · PVG 22:40 · LAX 06:40 · JFK 09:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.