React Native 'config.h' file not found 问题、 'glog/logging.h' file not found 问题、configure: error: C co...

1、在github 上面 git clone 一个RN 项目代码,npm install (yarn)后,准备运行iOS工程,发现'config.h' file not found ,恶心!!!

百度发现:这个是常见错误,只需要在项目根目录下(里面包含node_modules文件夹)运行以下命令(下面的两行同时复制,终端运行)即可解决:

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

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

注意:具体的版本号要根据报错的提示来定

 

 2、20190225 发现 'glog/logging.h' file not found 的问题(RN 版本 0.58),解决方式(参照上面的,复制下面2行,终端执行):

cd node_modules/react-native/third-party/glog-0.3.5

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

 

3、讨厌的错误,如下:

configure: error: C compiler cannot create executables

See `config.log' for more details

这个很是令人讨厌!!!出现的原因可能也不一致,下面列举不同时间出现的问题,解决方案和猜想。

20181123运行正常的项目,突然间就出现了config.h' file not found。按照上面的解决方式解决后,运行正常。第二天升级了mac 系统到macOS Mojave (版本10.14);Xcode 更新到Version 10.1 (10B61) 后,又出现了

configure: error: C compiler cannot create executables

See `config.log' for more details

当时百度上说是要安装 GCC 。就用:brew install gcc 安装了下最新版本的gcc 。但是安装完了之后,依然报如下错误(郁闷):

xcrun: error: SDK "iphoneos" cannot be located

xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'

configure: error: C compiler cannot create executables

See `config.log' for more details

最后有效解决方案:

打开xcode...,偏好设置 ,如下图,command line tools 要选中一个 (这个可能是当时安装了两个版本的XCODE,导致没有选择一个)。

20190313 发现glog/logging.h' file not found 问题后,按照上面20190225问题解决,却出现了 关键词如下的错误:

configure: error: C compiler cannot create executables

See `config.log' for more details

过程描述:前几天还是正常运行的,只是换了一个模拟器的机子,就出现了glog/logging.h' file not found ,按照上面的方式执行脚本,但是执行的过程中,出现了 configure: error: C compiler cannot create executables 问题。

解决方法及猜想: 1、glog/logging.h' file not found出现可能跟换模拟器有关(只是猜想)2、configure: error: C compiler cannot create executables 的出现可能跟刚才执行的另外一个RN项目有关,终端在开着另外一个RN项目的本地服务。解决方式:将终端关闭,再次运行项目,一切OK 。

转载于:https://www.cnblogs.com/richard-youth/p/10002565.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值