RN版本升级后,pod install报CocoaPods could not find compatible versions for pod "RCT-Folly"
问题背景
RN混合开发过程中,react-native使用版本从0.64升级到0.65。随着rn版本更新,ios依赖pod三方库也需要更新。
问题
在重新执行npm i更新node_modules后,在ios文件夹下需要更新pod依赖。
如果需要的pod三方库新版还没有被下载到本地过,
执行pod install会报错,比如碰到的下面RCT-Folly版本报错
[!] CocoaPods could not find compatible versions for pod "RCT-Folly"
xxx@xxxMBP ios % pod install
Using Expo modules
Auto-linking React Native modules for target `enterprise`: Picker, RNCAsyncStorage, RNGestureHandler, RNScreens, react-native-amap3d, and react-native-safe-area-context
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "RCT-Folly":
In snapshot (Podfile.lock):
RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
In Podfile:
RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
React-Core (from `../node_modules/react-native/`) was resolved to 0.65.3, which depends on
RCT-Folly (= 2021.04.26.00)
解决
如果是其他库报错,将RCT-Folly替换为对应三方库名
pod update RCT-Folly --no-repo-update