当我尝试运行"ionic cap sync"时,iOS升级出现了错误。
错误:
✖ 使用"pod install"更新iOS本地依赖项(可能需要几分钟):
✖ 更新ios:
[error] 运行更新时出错:分析依赖项
[!] CocoaPods找不到pod "Capacitor"的兼容版本:
在Podfile中:
Capacitor(来自 ../../node_modules/@capacitor/ios
)
发现满足Capacitor(来自
../../node_modules/@capacitor/ios)
依赖的规格,但它们需要更高的最小部署目标。
Podfile:
platform :ios, '11.0'
use_frameworks!
# workaround to avoid Xcode caching of Pods that requires
# Product -> Clean Build Folder after new Cordova plugins installed
# Requires CocoaPods 1.6 or newer
install! 'cocoapods', :disable_input_output_paths => true
def capacitor_pods
# Automatic Capacitor Pod dependencies, do not delete
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCommunityAdmob', :path => '../../node_modules/@capacitor-community/admob'
pod 'CapacitorCommunityFcm', :path => '../../node_modules/@capacitor-community/fcm'
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
# Do not delete
end
target 'App' do
capacitor_pods
# Add your Pods here
end
ionic信息 :
Ionic:
Ionic CLI : 5.4.16 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 5.3.3 @angular-devkit/build-angular : 0.1000.8 @angular-devkit/schematics : 10.0.8 @angular/cli : 10.0.8 @ionic/angular-toolkit : 2.3.3
Capacitor:
Capacitor CLI : 2.4.1 @capacitor/core : 2.4.1
Cordova:
Cordova CLI : 未安装 Cordova平台 : 不可用 Cordova插件 : 不可用
实用工具:
cordova-res : 未安装 native-run : 未安装
系统信息:
NodeJS : v14.17.1 (/usr/local/bin/node) npm : 6.14.13 操作系统 : macOS Big Sur
------已解决------
我将Capacitor和插件更新到最新版本,虽然我需要对代码进行一些更改(例如导入),但最终它可以正常工作而没有错误。
npx cap migrate
应该为你处理这个问题。更多信息请参见:https://capacitorjs.com/docs/updating/4-0 - eckza