升级到 React Native 0.63.0 后出现 Pod 安装错误

Ame*_*icA 5 javascript ios reactjs react-native react-native-ios

我使用的是 React Native 版本0.62.2,现在我升级到版本0.63.0,在运行npx pod-install安装 Pod 包后出现此错误:

CocoaPods 找不到 pod “ReactCommon/callinvoker” 的兼容版本:

在此处输入图片说明

Ame*_*icA 11

实际上,我只是删除Podfile.lock并删除整个Podfile并从React Native最新版本的全新安装的项目中添加新内容,这意味着它的内容应该是:

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/react_native_pods'

platform :ios, '10.0'

target '[YourProjectName]' do
  config = use_native_modules!
  use_react_native!(:path => config["reactNativePath"])

  target '[YourProjectName]Tests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target '[YourProjectName]-tvOS' do
  # Pods for [YourProjectName]-tvOS

  target '[YourProjectName]-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end
Run Code Online (Sandbox Code Playgroud)

注意很明显,您应该将项目名称替换为[YourProjectName].

提示如果您使用手动链接,请取消所有链接,我在手动链接react-native-vector-icons

之后,npx pod-install在项目的根目录上运行命令,一切都会回到正轨。