我刚刚更新到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_模块并进行了npm I.我也在iOS目录中安装了pod,但问题依然存在.我还做了pod回购更新.

推荐答案

对于React native 0.62版本

所以我想出来了

替换播客文件中的以下行

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

具有

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

Edit:

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

从iOS文件夹中删除Podfile.lock.

从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

Replace RNTodo 具有 your own project name, cd to iOS folder in the terminal and do pod install and everything should work

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

React-native相关问答推荐

错误:HostBody::get for prop NativeUnimoduleProxy中出现异常- Android虚拟设备(AVD)使用Expo测试React Native App时崩溃

Touchabble 不透明度不工作-react 本机

GetStream:更改消息气泡背景

每当我在 React Native Tab Navigator 中切换标签时触发 UseEffect

有人可以帮我实现 Font.loadAsync

Invariant Violation:Chrome 不支持在本机模块上调用同步方法

为了回调 URL 的目的,在 Expo 中运行的 React Native 元素的 info.plist 在哪里?

使用 Hooks 在功能组件中react-navigation 标题

缺少请求的请求令牌

submit提交后如何让 React Native TextInput 保持焦点?

使用条码 scanner 掩码的透明视图react-native相机

大型列表的 React-Native FlatList 性能问题

react-native平面列表初始滚动到底部

React Native - 为什么执行这个函数?

在 webview 中检测touch 是 Apple Pencil 还是手指(react-native)

使用 React Navigation 导航堆栈时重新渲染组件

使用 React Native 和 Redux 的动画状态管理

python 3与本机兼容吗?还是我应该按照 react 文档的建议安装 python 2?

无法解析模块react-native-screen

React Native 的最佳文件 Select 器