升级到 React Native 0.63.0 后 Pod 安装错误
Pod install error after upgrading to React Native 0.63.0
我使用的是 React Native 版本 0.62.2
,现在我升级到版本 0.63.0
,在 运行 npx pod-install
安装 Pod 包后,我收到此错误:
CocoaPods could not find compatible versions for pod “ReactCommon/callinvoker”:
实际上,我只是删除了 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
注意:很明显你应该用[YourProjectName]
替换你的项目名称。
提示:如果您使用手动链接,请取消所有链接,我在手动链接react-native-vector-icons
[=30 时遇到严重问题=]
之后,运行 npx pod-install
在项目的根目录下执行命令,一切都会回到正轨。
您应该在 ios 文件夹
中删除终端上的 Podfile.lock
和 运行 此代码
rm -rf ./*.xcworkspace && rm -rf ./pods && pod install
我使用的是 React Native 版本 0.62.2
,现在我升级到版本 0.63.0
,在 运行 npx pod-install
安装 Pod 包后,我收到此错误:
CocoaPods could not find compatible versions for pod “ReactCommon/callinvoker”:
实际上,我只是删除了 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
注意:很明显你应该用[YourProjectName]
替换你的项目名称。
提示:如果您使用手动链接,请取消所有链接,我在手动链接react-native-vector-icons
[=30 时遇到严重问题=]
之后,运行 npx pod-install
在项目的根目录下执行命令,一切都会回到正轨。
您应该在 ios 文件夹
中删除终端上的Podfile.lock
和 运行 此代码
rm -rf ./*.xcworkspace && rm -rf ./pods && pod install