1. /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js
改成
if (!version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') && !version.startsWith('com.apple.CoreSimulator.SimRuntime.tvOS')) {
continue;
}
if (
simulator.availability !== '(available)' &&
simulator.isAvailable !== true
) {
continue;
}
2.node_modules/react-native/React/Base/RCTModuleMethod.mm
改成
static BOOL RCTParseUnused(const char **input)
{
return RCTReadString(input, "__attribute__((unused))") ||
RCTReadString(input, "__attribute__((__unused__))") ||
RCTReadString(input, "__unused");
}
3.执行下列操作
For update config.h file,
1) Close your Xcode.
2) Open Terminal, go to your project's root folder and do:
cd node_modules/react-native/third-party/glog-{X}.{X}.{X}/
3) Run the configure script:
./configure
4) Open Xcode and try to run your app.
{X}: version number glog
最后按照
react-native run-ios --simulator "iPhone 8"