'config.h' file not found 的解决方法以及可能遇到的问题

运行Xcode 出现 'config.h' file not found

问题一解决方法:

1、cd node_modules/react-native/third-party/glog-0.3.4

2、在glog-0.3.4目录下执行命令 ../../scripts/ios-configure-glog.sh

 

接下去是转发自https://www.jianshu.com/p/48de6bd7d7f4 这位博主的方案:

这里可能会出现以下问题二

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

问题二解决方案:打开终端输入 xcode-select --install

回车后,系统弹出下载xcode,点击确认,下载完成后即可。(实际上不是下载xcode,可能下载xcode有关插件,下载时长约1分钟)

 

然后运行

1、cd node_modules/react-native/third-party/glog-0.3.4

2、../../scripts/ios-configure-glog.sh

可能出现以下第三个问题

 

'config.h' file not found 的解决方法以及可能遇到的问题

以上问题出现在Xcode 项目build的过程中,错误提示Xcode路径定位错误,那就通过命令行重新指定Xcode路径,网上有人说是安装过多个Xcode版本的缘故

解决方案:

终端运行:sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/

 

然后再运行

1、cd node_modules/react-native/third-party/glog-0.3.4

2、../../scripts/ios-configure-glog.sh