解決步驟
- 首先刪除node_modules文件夾,然后重新安裝
rm -rf node_modules/ && yarn cache clean && yarn install
- 運(yùn)行后如果發(fā)現(xiàn)依然報(bào)這個錯誤,查看third-party文件夾是否存在
ls node_modules/react-native/
- 如果發(fā)現(xiàn)third-party文件夾不存在邓线,執(zhí)行
node_modules/react-native/scripts/ios-install-third-party.sh
- 等待命令執(zhí)行完成后再次查看third-party文件夾就會出現(xiàn)了
ls node_modules/react-native/
再次運(yùn)行項(xiàng)目,如果發(fā)現(xiàn)依然報(bào)此錯誤抄课,那么在Xcode項(xiàng)目文件目錄下的Libraries/React.xcodeproj/ThirdParty/glog/config.h文件應(yīng)該是紅色的
- 然后繼續(xù)執(zhí)行
cd node_modules/react-native/third-party/glog-0.3.4
../../scripts/ios-configure-glog.sh
執(zhí)行完成后config.h文件就有了
那么再次運(yùn)行肯定就OK了虏两,即便有問題肯定也不是這個報(bào)錯了~
參考鏈接:
- https://github.com/facebook/react-native/issues/14382
- https://bbs.reactnative.cn/topic/4301/ios-rn-0-45%E4%BB%A5%E4%B8%8A%E7%89%88%E6%9C%AC%E6%89%80%E9%9C%80%E7%9A%84%E7%AC%AC%E4%B8%89%E6%96%B9%E7%BC%96%E8%AF%91%E5%BA%93-boost%E7%AD%89
而我這次,不幸就是如此铛只,報(bào)了另外一個新錯誤:
cannot be found: '/xxx/node_modules/reactnative/Libraries/WebSocket/libfishhook.a'
解決辦法:
image.png