RN V0.60.4源代码编译报错:ReactAndroid:buildReactNdkLib FAILED



  • 根据https://facebook.github.io/react-native/docs/building-from-source的文档指示操作,android-ndk使用r17c,报错如下:

    Task :ReactAndroid:buildReactNdkLib FAILED
    make: Entering directory C:/SVNcode/APP/RN 0.60/TestReactNativeNavigation/node_modules/react-native/ReactAndroid/src/main/jni/react/jni' Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-14. Android NDK: NDK_PROJECT_PATH==null. Please explicitly set APP_BUILD_SCRIPT. make: Leaving directoryC:/SVNcode/APP/RN 0.60/TestReactNativeNavigation/node_modules/react-native/ReactAndroid/src/main/jni/react/jni'
    Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
    Use '--warning-mode all' to show the individual deprecation warnings.
    See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
    25 actionable tasks: 2 executed, 23 up-to-date
    C:/Users/E0508417/Downloads/android-ndk-r17c-windows-x86_64/android-ndk-r17c/build//../build/core/add-application.mk:49: C:\SVNcode\APP\RN: No such file or directory
    C:/Users/E0508417/Downloads/android-ndk-r17c-windows-x86_64/android-ndk-r17c/build//../build/core/add-application.mk:49: 0.60\TestReactNativeNavigation\node_modules\react-native\ReactAndroid/src/main/jni/Application.mk: No such file or directory
    C:/Users/E0508417/Downloads/android-ndk-r17c-windows-x86_64/android-ndk-r17c/build//../build/core/add-application.mk:108: *** Android NDK: Aborting. . Stop.
    FAILURE: Build failed with an exception.

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

    Process 'command 'C:\Users\E0508417\Downloads\android-ndk-r17c-windows-x86_64\android-ndk-r17c\ndk-build.cmd'' 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. Run with --scan to get full insights.
    • Get more help at https://help.gradle.org
      BUILD FAILED in 31s


  • 0_1568180811242_5bb34711-e21d-4e5e-b554-9601069fa7f4-image.png


Log in to reply