我正在尝试将我的项目从旧的RN(本机)版本升级到RN59。我所做的是,我遵循diff-purge并在项目中手动进行更改。一切都很好,直到我达到0.58.1
iOS:运行正常。
Android:尝试构建时,我会遇到ReactAndroid:buildReactNdkLib失败的问题。
尝试更改
尝试重新启动笔记本电脑
反应本机环境信息:
System:
OS: macOS 10.14.4
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 21.12 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.13.0 - /usr/local/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 23.0.1, 25.0.2, 26.0.2, 27.0.3, 28.0.2, 28.0.3
System Images: android-19 | Google APIs Intel x86 Atom, android-21 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.1 AI-173.4720617
Xcode: 10.2/10E125 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.1 => 0.58.1
npmGlobalPackages:
react-native-cli: 2.0.1
这些是我尝试./gradlew build时的错误
/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/FBString.h:48:18: error: missing binary operator before token "("
#if __has_include(<bits/c++config.h>)
^
make: *** [/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/reactnativejni/JMessageQueueThread.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Format.h:495:0,
from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/dynamic-inl.h:22,
from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/dynamic.h:717,
from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/../ReactCommon/cxxreact/../cxxreact/CxxModule.h:13,
from ./CxxModuleWrapperBase.h:11,
from ./CxxModuleWrapper.h:8,
from ./CxxModuleWrapper.cpp:6:
/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Format-inl.h: In member function 'void folly::FormatValue<T, typename std::enable_if<(std::is_integral<_Tp>::value && (! std::is_same<T, bool>::value))>::type>::doFormat(folly::FormatArg&, FormatCallback&) const':
/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Format-inl.h:511:17: error: expected ')' before 'PRIuMAX'
"%" PRIuMAX,
^
In file included from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Format.h:495:0,
from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/dynamic-inl.h:22,
from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/dynamic.h:717,
from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/../ReactCommon/cxxreact/../cxxreact/NativeModule.h:12,
from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/../ReactCommon/cxxreact/../cxxreact/JSExecutor.h:11,
from ./JSLoader.h:11,
from ./JSLoader.cpp:6:
/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Format-inl.h: In member function 'void folly::FormatValue<T, typename std::enable_if<(std::is_integral<_Tp>::value && (! std::is_same<T, bool>::value))>::type>::doFormat(folly::FormatArg&, FormatCallback&) const':
/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Format-inl.h:511:17: error: expected ')' before 'PRIuMAX'
"%" PRIuMAX,
^
In file included from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Format.h:495:0,
from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/dynamic-inl.h:22,
from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/dynamic.h:717,
from /Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/../ReactCommon/cxxreact/../cxxreact/CxxModule.h:13,
from ./CxxModuleWrapperBase.h:11,
from ./CxxModuleWrapper.h:8,
from ./CatalystInstanceImpl.h:11,
from ./CatalystInstanceImpl.cpp:6:
/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Format-inl.h: In member function 'void folly::FormatValue<T, typename std::enable_if<(std::is_integral<_Tp>::value && (! std::is_same<T, bool>::value))>::type>::doFormat(folly::FormatArg&, FormatCallback&) const':
/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Format-inl.h:511:17: error: expected ')' before 'PRIuMAX'
"%" PRIuMAX,
^
make: *** [/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/reactnativejni/JSLoader.o] Error 1
make: *** [/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/reactnativejni/CxxModuleWrapper.o] Error 1
make: *** [/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/reactnativejni/CatalystInstanceImpl.o] Error 1
make: Leaving directory `/Users/localPC/Desktop/Development/project/node_modules/react-native/ReactAndroid/src/main/jni/react/jni'
> Task :ReactAndroid:buildReactNdkLib FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ReactAndroid:buildReactNdkLib'.
> Process 'command '/Users/localPC/Library/Android/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. Run with --scan to get full insights.