1.React Native 中在xcode10运行提示 ‘config.h’ file not found’
解决方法:
在项目终端执行以下命令
cd node_modules/react-native/third-party/glog-0.3.4
../../scripts/ios-configure-glog.sh
clean the project and build again, the error is gone,也可以参见github中的处理意见:config.h’ file not found
其实执行 .sh 命令之后Terminal界面的一些处理流程,我们不难看出,这个命令是check .h头文件的引用情况,然后重新建立关联关系
2.Build input file cannot be found: ‘…/node_modules/react-native/Libraries/WebSocket/libfishhook.a’
解决方案:
按照1-2-3步骤进行先删除掉libfishhook.a文件,然后再重新加入即可
3.Xcode10构建方式切换,使用旧的构建方式
由于Xcode10会默认使用新的构建方式,感觉不是很顺手,于是我们需要切换到旧的构建方式,构建方式如下:
File->Project Settings->Build Systems 选择Legacy Build System
4.Could not find iPhone 6 simulator
在升级完系统之后,使用react-native run-ios命令进行打开模拟器时,会提示该Could not find iPhone 6 simulator
react: 16.0.0 => 16.0.0
react-native: 0.51.0 => 0.51.0
Xcode: Xcode 11.2 Build version 11B52
解决方案:
1.进入打开findMatchingSimulator文件
cd ./node_modules/react-native/local-cli/runIOS
打开文件findMatchingSimulator.js,然后替换内容。
第一步替换:
if (version.indexOf('iOS') !== 0) {
continue;
}
为
if (!version.includes('iOS')) {
continue;
}
第二步替换:
if (simulator.availability !== '(available)') {
continue;
}
为
if (simulator.isAvailable !== true) {
continue;
}
替换之后,重新运行react-native run-ios
即可正常运行