RN 使用react navigation的案例时运行pod-install报错
Auto-linking React Native modules for target `Entry_task_ts`: RNScreens and react-native-safe-area-context
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] CocoaPods could not find compatible versions for pod "react-native-safe-area-context":
In Podfile:
react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
Specs satisfying the `react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)` dependency were found, but they required a higher minimum deployment target.
Couldn't install Pods. Updating the Pods project and trying again...
看问题描述好像是react-native-safe-area-context这个包应用的问题,我在node_modules已经安装了这个包但是一直报错。
通过一番查找,发现是podfile配置的ios版本太低,react-native-safe-area-context最低版本是支持ios11.0。
但是我构建的版本是ios10.0,修改版本之后就可以正常构建了

在尝试使用react-navigation库构建React Native应用时,遇到pod install报错,原因是react-native-safe-area-context依赖的iOS版本高于项目设定的目标版本。通过检查发现,项目的Podfile配置的iOS版本过低,而react-native-safe-area-context要求最低为iOS 11.0。将项目的目标iOS版本提升到11.0或以上后,成功解决了构建问题。

2981

被折叠的 条评论
为什么被折叠?



