CocoaPods could not find compatible versions for pod "Capacitor"
Asked Answered
C

3

16

When i try "ionic cap sync" there is a error in ios update

Error :

✖ Updating iOS native dependencies with "pod install" (may take several minutes): ✖ update ios: [error] Error running update: Analyzing dependencies [!] CocoaPods could not find compatible versions for pod "Capacitor": In Podfile: Capacitor (from ../../node_modules/@capacitor/ios)

Specs satisfying the Capacitor (from ../../node_modules/@capacitor/ios) dependency were found, but they required a higher minimum deployment target.

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 info :

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 : not installed Cordova Platforms : not available Cordova Plugins : not available

Utility:

cordova-res : not installed native-run : not installed

System:

NodeJS : v14.17.1 (/usr/local/bin/node) npm : 6.14.13 OS : macOS Big Sur

------SOLVED------

I updated the capacitor and plugins to the latest version.it finally worked without error even though i had to make a few changes to the code(exmple imports so little changes)

Chinkapin answered 21/6, 2021 at 7:13 Comment(0)
B
11

One of the plugins you are using (or both) are updated for capacitor 3, which requires iOS 12, but you are still on capacitor 2, which allows iOS 11.

Ideally you should update to capacitor 3, but you can install older versions of the plugins, check their changelogs to see in which version they supported capacitor 3 and install the previous one.

Bootleg answered 21/6, 2021 at 21:50 Comment(0)
O
34

My issues comes after upgrade capacitor from 2.x to 3.x. I fix it by changing:

File: ios/App/Podfile

Line:

platform :ios, '11.0'

to:

platform :ios, '12.0'
Obstetric answered 27/10, 2021 at 22:35 Comment(3)
If anyone's found this after updating from Capacitor 3 to Capacitor 4 - it's the same; update from 12.0 to 13.0; and in XCode, change your build deployment target from 12.0 to 13.0 - details on that here: #63687467Streetman
Actually - you shouldn't have to do this - npx cap migrate should handle this for you. More info here: capacitorjs.com/docs/updating/4-0Streetman
Just updating, the same error occurred with me now, and I updated from platform :ios, '12.0' to platform :ios, '13.0', and that occurred after upgrading capacitor 3 to 4.Premeditation
B
11

One of the plugins you are using (or both) are updated for capacitor 3, which requires iOS 12, but you are still on capacitor 2, which allows iOS 11.

Ideally you should update to capacitor 3, but you can install older versions of the plugins, check their changelogs to see in which version they supported capacitor 3 and install the previous one.

Bootleg answered 21/6, 2021 at 21:50 Comment(0)
M
10

Update for capacitor 4, you can sort this out by running

npm i @capacitor/cli@latest

Then...

npx cap migrate
Melson answered 5/9, 2022 at 13:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.