CocoaPods 无法为 pod“ ReactCommon/jscallinvker”找到兼容版本:

我刚刚更新到 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 _ module 并且做了 npm i。我还在 iOS 目录中做了 pod install,但问题仍然存在。我还做了豆荚回收更新。

59715 次浏览

对于 React native0.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操作,所有操作都应该正常

RN0.63也放弃了对 iOS 9的支持

我认为 jscallinvoker版本不适合尝试替换

jscallinvoker

callinvoker

如果你已经有了 调用者,但你仍然有一个错误。这个操作帮助我:

 react-native start --reset-cache
rm -rf node_modules/
rm -rf package-lock.json
cd ios
pod deintegrate
cd ..
rm -rf ios/Podfile.lock
npm install
npm audit fix
react-native link
cd ios
pod install
cd ..
react-native run-ios

如果还有人对 React NativeVersion 0.63.0有问题,那么这个方法对我很有用

按以下方式更新调用方 pod

pod 'React-callinvoker', :path => "#{rnPrefix}/ReactCommon/callinvoker"

我通过将 Podfile中的行从

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

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

在 RN 0.63.0中,您可以从 podfile中移除所有 RN 吊舱,只需在目标内包含以下行即可。

config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])

podfile开头的站台线后面还要加上这条线:

require_relative '../node_modules/react-native/scripts/react_native_pods'

然后,删除 Pods目录、 Podfile.lock和工作区文件。

React-National 现在正在动态配置 pods,因此不再需要列出每个 pods;

(: path = > config [“ reactNativePath”])

这是你从一个63.1基本的 Podfile 中得到的:

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


platform :ios, '10.0'


target 'test' do
config = use_native_modules!


use_react_native!(:path => config["reactNativePath"])


target 'testTests' do
inherit! :complete
end




use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end


target 'test-tvOS' do


target 'test-tvOSTests' do
inherit! :search_paths
end
end

本地0.63.0反应升级研究

这个问题发生在我的项目后升级 React Native到版本 0.63.0,所以对于解决方案,我只是删除 Podfile.lock和删除整个 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 '[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

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

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

根据 https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.2进行手动调整可能会有所帮助。

然后必须运行命令 cd ios && pod install

在将 工作流程0.38(RN 0.62)升级到0.39(RN 0.63)时遇到了这个问题。编辑的回答@Priish 确实工作,但它说这 错误

[!] Unable to find a target named `RNTodo-tvOS` in project `RNTodo.xcodeproj`, did find `RNTodo`.

还有

[!] Unable to find a target named `RNTodoTests` in project `RNTodo.xcodeproj`, did find `RNTodo`.

通过改变下面的 Podfile 得到了解决方案

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


platform :ios, '10.0'


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


# 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


什么改变了?

在顶部添加单模块

require_relative '../node_modules/react-native-unimodules/cocoapods.rb'

config = use_native_modules!之前添加 use_unimodules!

移开

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

移开

target 'RNTodo-tvOS' do
# Pods for RNTodo-tvOS


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

对于 仿生人(如果升级后出现错误)

android/build.gradle 改变

ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
}

ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
}

RN 0.63放弃了对 iOS 9的支持

所以在分离舱文件里 更换

  • 平台: ios,’9.0’*
  • 平台: ios,’10.0’*

还有

  • Pod‘ ReactCommon/callinvinker’,: path = > “ . ./node _ module/response-national/ReactCommon”
  • Pod‘ React-callinvker’,: path = > “ . ./node _ module/response-national/ReactCommon/callinvker”

在终端运行中转到 IOS 文件夹

  • 吊舱安装
  • 运行本地的 run-ios
platform :ios, '11.0'

我通过如下修改解决了这个问题(版本0.63.4)

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


# Maybe someone is


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

名片


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

如果您已升级到0.65以上的本机反应, 您需要对 podfile 进行更改

平台: ios,’10.0’

平台: ios,’11.0’