React Native中Installing Flipper-Glog (0.3.6) 和 Installing glog (0.3.5) 安装报错解决方案

一、报错
Installing Flipper-Glog (0.3.6) 报错

configure: WARNING: 'missing' script is too old or missing
Invalid configuration `arm64-apple-darwin20.5.0': machine `arm64-apple' not recognized
configure: error: /bin/sh ./config.sub arm64-apple-darwin20.5.0 failed

Installing glog (0.3.5) 报错

二、解决方案
1、编辑./node_modules/react-native/scripts/react_native_pods.rbFlipper-Glog to 0.3.6改成0.3.9
2、编辑./node_modules/react-native/scripts/ios-configure-glog.sh
CURRENT_ARCH="${CURRENT_ARCH}"的下面增加以下两行

wget -O config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
wget -O config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'

参考来源:https://github.com/facebook/react-native/issues/32033#issuecomment-902560416
参考来源:https://github.com/facebook/react-native/pull/30753/commits/9d66b702be27a2866bf9def08d57c8c5e18587dc

三、其他解决方案
方案一:

git config --global core.autocrlf false

方案二:

sudo xcode-select --switch /Applications/Xcode.app
cd ios && pod install

参考来源:https://github.com/facebook/react-native/issues/25561

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容