React Native - CocoaPods 找不到 pod“FBReactNativeSpec”的兼容版本

Atu*_*mar 6 react-native

React Native版本已从0.61.5更新到0.65.0。

pod install在我收到错误说明后,

[!] CocoaPods could not find compatible versions for pod "FBReactNativeSpec":
  In Podfile:
    FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)

Specs satisfying the `FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)` dependency were found, but they required a higher minimum deployment target.
Run Code Online (Sandbox Code Playgroud)

Podfile 中 FBReactNativeSpec 的路径是,

pod 'FBReactNativeSpec', :path => "../node_modules/react-native/React/FBReactNativeSpec"
Run Code Online (Sandbox Code Playgroud)

我不知道如何解决这个问题。

小智 6

尝试更新 podfile 中的平台版本。

platform :ios, '11.0' => change 11 to 15.

这对我有用


小智 1

这可能是依赖项错误,您可能需要安装react-native-codegen库,例如:

如果您使用yarn打包器:

yarn add --dev react-native-codegen
Run Code Online (Sandbox Code Playgroud)

如果您使用npm打包器:

npm install react-native-codegen --force
Run Code Online (Sandbox Code Playgroud)

它会将库添加到package.json

"dependencies": {
   "react-native-codegen": "^0.0.7"
}
Run Code Online (Sandbox Code Playgroud)

查看此链接以获取更多信息。

另外,我建议您遵循React Native Upgrade Helper文档进行Package.json更改Podfile