CocoaPods 找不到 pod "ReactCommon/jscallinvoker" 的兼容版本:

新手上路,请多包涵

我刚刚更新到 RN v0.62,在 iOS 上运行应用程序给了我以下错误

!] CocoaPods could not find compatible versions for pod "ReactCommon/jscallinvoker":
  In snapshot (Podfile.lock):
    ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)

  In Podfile:
    ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)

None of your spec sources contain a spec satisfying the dependency: `ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)`.

我删除了所有 node_modules 并做了 npm i。我也在 iOS 目录中进行了 pod install ,但问题仍然存在。我也做了 pod repo 更新。

原文由 Pritish 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 850
1 个回答

对于 React native 0.62 版本

所以我想通了

替换 Podfile 中的以下行

pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"

pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"

编辑:

如果您已更新到 React Native 版本 0.63

从 iOS 文件夹中删除 Podfile.lock 。做 npm i

从 iOS 文件夹打开 podfile

删除所有内容并复制以下内容

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 'RNTodo' do
  config = use_native_modules!
  use_react_native!(:path => config["reactNativePath"])

  target 'RNTodoTests' 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 'RNTodo-tvOS' do
  # Pods for RNTodo-tvOS

  target 'RNTodo-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

RNTodo 替换为您自己的项目名称,cd 到终端中的 iOS 文件夹并执行 pod install 一切都应该工作

此外 RN 0.63 已放弃对 iOS 9 的支持

原文由 Pritish 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题