在有些版本的react ntive下面,当运行npm install之后准备运行iOS工程的时候,可能会遇到一下两种编译错误:
'config.h' file not found'glog/logging.h' file not found
这两个错误都是和react native 中的glog文件有关,原因可能是没有配置完全。
解决办法的完整流程是:
-
cd到node_modules/react-native下面,如果没有发现third-party目录。就运行./scripts/ios-install-third-party.sh, 安装第三方库。 -
third-party存在的情况下,cd到./third-party/glog-0.3.5目录下,运行../../scripts/ios-configure-glog.sh
如此之后,你就能在glog-0.3.5目录下面发现config.h 和 logging.h 文件了。