Pol
Pol

Reputation: 464

Flutter: CocoaPods could not find compatible versions for pod "Firebase/Messaging"

I'm trying to run flutter on iOS Simulator and when executing flutter run the next error appears:

[!] CocoaPods could not find compatible versions for pod "Firebase/Messaging": In Podfile: firebase_messaging (from .symlinks/plugins/firebase_messaging/ios) was resolved to 9.1.3, which depends on Firebase/Messaging (= 7.11.0) None of your spec sources contain a spec satisfying the dependency: Firebase/Messaging (= 7.11.0).

Does anyone know why is this happening?

What if tried:

  1. Flutter clean + flutter pug get
  2. Delete de iOS folder and then flutter create .
  3. On the iOS folder delete Pods file and Podfile.dock then pod init + pod install causing same error

The packages i'm using

Configuartion

I preferred to ask here before creating a new issue on Github If this is happening to someone else then I'll create a new issue on Github.

Upvotes: 10

Views: 15209

Answers (6)

Ahmed Raza
Ahmed Raza

Reputation: 429

instead of pod repo update

arch -x86_64 pod install --repo-update

Upvotes: 0

Pol
Pol

Reputation: 464

This problem can occur when using a Mac with the M1 chip.

The 'CocoaPods could not find compatible versions for pod "Firebase/Messaging' error wil be solved when solving first the 'pod repo update' error.

I've tried different solutions but the ones that worked for me was the following. Steps to follow:

  1. On the terminal run: sudo arch -x86_64 gem install ffi
  2. On the ios project folder run: arch -x86_64 pod install --repo-update instead of pod repo update (just in case delete the Podfile.lock before this step)
  3. Now your build should be successful, press F5.

Ther are more solutions mentioned on Github.

I finally found mine on this comment.

Upvotes: 16

Omatt
Omatt

Reputation: 10519

I was able to solve similar error by updating the target iOS platform to 10.0. Update the platform configured in the Podfile to platform :ios, '10.0'. I've also had to update the iOS Deployment Target to 10.0 - located on Runner > Info > Deployment Target

Xcode iOS Deployment Target

After that, deleting the Podfile.lock with rm -rf Podfile.lock then running pod update and pod install solved the issue for me.

Upvotes: 3

Micheal C Wallas
Micheal C Wallas

Reputation: 525

pod update Firebase/Messaging

fixed me up

Upvotes: 1

user501836
user501836

Reputation: 1186

you should update the cocoa master repos with

pod repo update

then

pod install

again

Upvotes: 4

Dr Younss AIT MOU
Dr Younss AIT MOU

Reputation: 1117

don't specify firebase_messaging version

firebase_messaging: // remove version from here 

Upvotes: 0

Related Questions