CocoaPods 找不到 pod “ReactCommon/jscallinvoker"的兼容版本: [英] CocoaPods could not find compatible versions for pod "ReactCommon/jscallinvoker":
问题描述
我刚刚更新到 RN v0.62,在 iOS 上运行应用程序出现以下错误
I just updated to RN v0.62 and running app on iOS gives me following error
!] 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,但问题仍然存在.我也做了 pod repo 更新.
I deleted all node_modules and did npm i. I also did pod install in iOS directory but the issue persists. I also did pod repo update.
推荐答案
For React native
0.62 版本
For React native
0.62 version
所以我想通了
替换 Podfile 中的以下行
Replace following line in your Podfile
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
与
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
如果您已更新到 React Native
0.63 版
If you have updated to React Native
version 0.63
从 iOS 文件夹中删除 Podfile.lock
.做 npm i
Delete Podfile.lock
from iOS folder.
Do npm i
从iOS文件夹打开podfile
删除所有内容并复制以下内容
Delete everything and copy below contents
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
一切正常
Replace RNTodo
with your own project name, cd to iOS folder in the terminal and do pod install
and everything should work
还有 RN
0.63 已经放弃了对 iOS 9 的支持
Also RN
0.63 has dropped support for iOS 9
这篇关于CocoaPods 找不到 pod “ReactCommon/jscallinvoker"的兼容版本:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!