Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

  • cupertino_icons: ^1.0.2
  • cross_connectivity: ^3.0.2
  • crypto: ^3.0.1
  • device_info_plus: ^1.0.1
  • encrypt: ^5.0.0
  • firebase_analytics: ^8.0.2
  • firebase_core: ^1.1.0
  • firebase_crashlytics: ^2.0.2
  • firebase_messaging: ^9.1.3
  • flutter_barcode_scanner: ^2.0.0
  • flutter_card_swipper: ^0.4.0
  • flutter_easyloading: ^3.0.0
  • flutter_local_notifications: ^5.0.0+1
  • flutter_speed_dial: ^3.0.5
  • fluttertoast: ^8.0.3
  • http: ^0.13.2
  • image: ^3.0.2
  • image_picker: ^0.7.4
  • intl: ^0.17.0
  • location: ^4.1.1
  • mime_type: ^1.0.0
  • path_provider: ^2.0.1
  • permission_handler: ^6.1.3
  • shared_preferences: ^2.0.4
  • sqflite: ^2.0.0+3
  • url_launcher: ^6.0.3
  • webview_flutter: ^2.0.4

Configuartion

  • iOs Deployment Target 12.1
  • Flutter 2.0.4
  • flutter doctor -v Result -> all green colored

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.

like image 398
Pol Avatar asked Apr 29 '21 15:04

Pol


People also ask

How do I specify pod version in Podfile?

<Specifying pod versions Later on in the project you may want to freeze to a specific version of a Pod, in which case you can specify that version number. Besides no version, or a specific one, it is also possible to use logical operators: '> 0.1' Any version higher than 0.1. '>= 0.1' Version 0.1 and any higher version.

Do I need Ruby to install CocoaPods?

Cocoapods is built on top of Ruby, so you would need to install that in your system before using Cocoapods.

Is Firebase/core compatible with CocoaPods?

CocoaPods could not find compatible versions for pod "Firebase/Core": In Podfile: Firebase/Core Specs satisfying the `Firebase/Core` dependency were found, but they required a higher minimum deployment target.

How to use Firebase core with flutter?

My version is [email protected] . If you have more packages, use npm list -g to list them, and then install them in the new NodeJS version. Run firebase login locally access your Firebase Console. [In your Flutter app's folder root] Run flutter clean & flutter pub get. Add Firebase Core ( pub.dev) to your app and others Firebase's libraries.

What does error 33m mean in CocoaPods?

Error output from CocoaPods: ↳ [33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding. Consider adding the following to ~/.profile: export LANG=en_US.UTF-8 [0m [!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified.


Video Answer


4 Answers

you should update the cocoa master repos with

pod repo update

then

pod install

again

like image 33
user501836 Avatar answered Oct 09 '22 18:10

user501836


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.

like image 139
Pol Avatar answered Oct 09 '22 18:10

Pol


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.

like image 40
Omatt Avatar answered Oct 09 '22 18:10

Omatt


pod update Firebase/Messaging

fixed me up

like image 1
Micheal C Wallas Avatar answered Oct 09 '22 17:10

Micheal C Wallas