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

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:
Flutter clean + flutter pug get
Delete de iOS folder and then flutter create .
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.

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:
On the terminal run: sudo arch -x86_64 gem install ffi
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)
Now your build should be successful, press F5.
Ther are more solutions mentioned on Github.
I finally found mine on this comment.

you should update the cocoa master repos with
pod repo update
then
pod install
again

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
After that, deleting the Podfile.lock with rm -rf Podfile.lock then running pod update and pod install solved the issue for me.

pod update Firebase/Messaging
fixed me up

don't specify firebase_messaging version
firebase_messaging: // remove version from here

instead of pod repo update
arch -x86_64 pod install --repo-update

try this:
firebase_core: null
firebase_crashlytics: null
firebase_messaging: null

Related

Flutter Firebase Pubspec.yaml Update-- Getting [!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":

After updating my pubspect yaml versions from
firebase_auth: ^1.0.1
firebase_core: ^1.0.2
cloud_firestore: ^1.0.3
to
firebase_auth: ^1.1.2
firebase_core: ^1.1.0
cloud_firestore: ^1.0.7
I'm getting the following output:
checking is only perfomed in repo update
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In snapshot (Podfile.lock):
Firebase/CoreOnly (= 7.3.0)
In Podfile:
firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 1.1.0, which depends on
Firebase/CoreOnly (= 7.11.0)
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* changed the constraints of dependency `Firebase/CoreOnly` inside your development pod `firebase_core`.
You should run `pod update Firebase/CoreOnly` to apply changes you've made.
After running 'pod init' inside iOS folder, I'm getting
[!] No Xcode project found, please specify one
and after running 'pod install' within the iOS folder also,
[!] No `Podfile' found in the project directory.
However. The Podfile DOES EXIST.
[Please refer to the image attached][1]
Also, my Flutter Doctor is showing no errors.
Thanks, and all best,
-A.V.
[1]: https://i.stack.imgur.com/DR2kx.png

Flutter firebase - update packeges

I try to update firebase to nullsafe.
Here is my pubspec:
firebase_core: "^0.7.0"
firebase_auth: "^0.20.1"
firebase_crashlytics: "^0.4.0+1"
cloud_firestore: "^0.16.0+1"
cloud_functions: "^0.9.0"
firebase_storage: "^7.0.0"
firebase_messaging: "^8.0.0-dev.15"
firebase_remote_config: "^0.8.0-dev.0"
firebase_analytics: "^7.0.1"
firebase_database: "^6.0.0"
firebase_dynamic_links: "^0.7.0+1"
firebase_in_app_messaging: "^0.3.0+1"
firebase_performance: "^0.5.0+1"
But I can't do it because have an errors:
Because firebase_remote_config >=0.8.0-dev.0 <0.9.0-dev.0 depends on firebase_remote_config_platform_interface ^0.1.0-dev.0 which depends on firebase_core ^0.5.2, firebase_remote_config >=0.8.0-dev.0 <0.9.0-dev.0 requires firebase_core ^0.5.2.
So, because EMA depends on both firebase_core ^0.7.0 and firebase_remote_config ^0.8.0-dev.0, version solving failed.
Flutter Firebase dependency hell !!!
What to do?
Please show guaranteed working plugins firebase pluging(storage,auth,store,crashlitics)
You are getting version conflicts. You can solve them by letting pub find the version that is compatible with your other dependencies. Like this:
firebase_remote_config: any
If you get more of these errors, I suggest you to put all of packages to any then run flutter pub get and finally look in the pubspec.lock file and see what versions you got. Now you can put those versions in pubspec.yaml.

Flutter path_provider and sdk version mismatch

The current Dart SDK version is 2.10.5.
Because path_provider 2.0.1 requires SDK version >=2.12.0-259.9.beta <3.0.0 and no versions of path_provider match >2.0.1 <3.0.0, path_provider ^2.0.1 is forbidden.
So, because harmonoid depends on path_provider ^2.0.1, version solving failed.
pub get failed (1; So, because harmonoid depends on path_provider ^2.0.1, version solving failed.)
How do i solved this error? this is my pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.8.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
animations: ^1.1.2
provider: ^4.3.3
assets_audio_player:
git: https://github.com/alexmercerind/Flutter-AssetsAudioPlayer
media_metadata_retriever: ^0.0.2+1
http: ^0.12.2
path: ^1.7.0
path_provider: ^2.0.1
flutter_local_notifications: ^3.0.3
url_launcher: ^5.5.0
permission_handler: ^5.0.1+1
share: ^0.6.5+4
palette_generator: ^0.2.3
implicitly_animated_reorderable_list: ^0.3.2
dev_dependencies:
flutter_test:
sdk: flutter
error
My Dart SDK version is 2.12.0, and the Flutter version is 2.0.1. I created a new project and copied all your dependencies. The project worked without any problems.
For saving your time, I recommend upgrading to the stable channel and Flutter 2 using these commands or this link.
flutter channel stable
flutter upgrade
If you don't want to migrate your Flutter and Dard SDK versions yet,
I would recommend you to try and remove the version from the line:
path_provider: ^2.0.1
so it would look like this: path_provider:
run: pub get again
run your project again
Eventually I would recomment to migrate to the newest version of the SDKs and upgrade all your dependencies. This is just a temporary solution.

How to solve multi dependency version conflicts simply?

I have imported a project in android studio flutter. But, there is an incredible amount of version conflict coming in. If one solves other rises and if that goes down, other one rises. I am trying to get all packages and it is showing me the following error as below.
Because date_utils >=0.1.0+3 depends on intl ^0.16.0 and prokit_flutter depends on intl 0.17.0-nullsafety.2, date_utils >=0.1.0+3 is forbidden.
So, because prokit_flutter depends on date_utils ^0.1.0+3, version solving failed.
pub get failed (1; So, because prokit_flutter depends on date_utils ^0.1.0+3, version solving failed.)
Process finished with exit code 1
And my pubspec.yaml code is as below.
name: prokit_flutter
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.6.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
url_launcher: 5.0.3
nb_utils: 3.1.6+7
google_fonts: 1.1.0
animations: 1.1.2
intl: 0.17.0-nullsafety.2
http: 0.12.2
firebase_core: 0.5.0
firebase_analytics: 6.0.0
firebase_crashlytics: 0.1.4+1
google_sign_in: 4.5.3
html: 0.14.0+3
share: 0.6.5
mobx: ^1.2.1+2
flutter_mobx: ^1.1.0+2
flutter_statusbarcolor: 0.2.3
simple_animations: 1.3.8
snaplist: 0.1.8
flutter_svg: 0.18.1
flutter_slidable: 0.5.7
flutter_staggered_grid_view: 0.3.2
flutter_staggered_animations: 0.1.2
geolocator: 5.3.2+2
geocoder: 0.2.1
google_maps_flutter: 0.5.21+3
clustering_google_maps: 0.1.2
razorpay_flutter: 1.2.2
signature: 3.2.0
liquid_swipe: 1.5.0
lipsum: 1.0.1
flutter_colorpicker: 0.3.4
clippy_flutter: 1.1.1
flutter_tags: ^0.4.8
image_picker_gallery_camera: 0.1.6
video_player: 0.10.11+2
charts_flutter: ^0.9.0
like_button: ^1.0.1
flutter_reaction_button: ^1.0.1
lottie: ^0.6.0
showcaseview: ^0.1.6
date_utils: ^0.1.0+3
cached_network_image: ^2.3.1
flutter_localizations:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
mobx_codegen:
build_runner: ^1.9.0
#flutter packages pub run build_runner build
flutter:
uses-material-design: true
assets:
- images/smartDeck/images/
fonts:
- family: Andina
fonts:
- asset: fonts/andina.ttf
And there are 4-5 dependency version error. How can I solve this version error thing in one click or I can just somehow skip this version problem and get the thing done. Please help, Thanks in Advance.
Whenever conflicts between dependencies occur, the simplest solution is to just remove the version number of both that dependencies and type 'any' without quotes in front of them.
for example let's say this following two dependency conflicts:
shared_preferences: ^0.5.7+3
requests: ^3.3.0
then do following:
shared_preferences: any
requests: any
After this do pub get and issue will be resolved. Now, most importantly, don't leave any dependency on this form. instead goto pubspec.lock file and search these two dependencies. Flutter itself chooses the versions that don't conflict, copy those and replace it to pubsec.yaml
You can use dependency_overrides in your pubspec.yaml to force a specific package version. The package version will override any reference to a dependency in the entire app.
In your case you could use
dependencies:
flutter:
sdk: flutter
...
cupertino_icons: ^1.0.0
dependency_overrides:
intl: ^0.17.0-nullsafety.2
See dependency_overrides for more information.
Replace intl: 0.17.0-nullsafety.2 version with intl: 0.16.1 and remove intl from dependency overrides.
Now, run pub get command.
You can simply change the version of package that is causing conflic with another version which is compatible with your dart SDK. I tried it and the problem was solved.
had the same problem; ran the following command:
flutter pub upgrade --major-versions
if you don't mind having the latest version of all the dependencies while solving version conflict issues, this should be a quick fix.
I had this problem after resetting my Mac mini.
If you still have the pubspec.lock file at the last successful run (or get it from another dev, on that dev's computer the project is still running).
flutter clean.
Replace pubspec.lock by the old one.
Run the project again.

Shared preferences in flutter giving error on pub get

I started getting this error when adding shared preferences in a flutter app. It was working before and now I get
Because <app_name> depends on shared_preferences >=0.4.0 which requires Flutter SDK version >=0.1.4 <2.0.0, version solving failed.
pub upgrade failed (1; Because <app_name> depends on shared_preferences >=0.4.0 which requires Flutter SDK version >=0.1.4 <2.0.0, version solving failed.)
exit code 1
Here is the relevant part of my pubspec.yaml
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
http: "0.12.2"
progress_dialog: ^1.2.4
shared_preferences: ^0.5.12
I am new to flutter, and can't figure it out. I know that it was working before and it suddenly started giving this error.
It seems like your flutter sdk is not updated. You would have to update it by running this command in terminal/cmd:
flutter upgrade
Here's a guide on how to upgrade your flutter sdk version: https://flutter.dev/docs/development/tools/sdk/upgrading
It seems like you use an old package, which depends on shared_preferences: ^ 0.4.0 and sdk version lower than 2.0.0. Neither http nor progress_dialog depends on shared_preferences. If you don't use other packages in your app, let me know, because it is weird. Otherwise (if you use more packages that you listed in the question) just use dependency_overrides to override dependencies
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
http: "0.12.2"
progress_dialog: ^1.2.4
shared_preferences: ^0.5.12
dependency_overrides:
shared_preferences: ^0.5.12
had a similar problem, I changed the shared_preference to the latest version, as well as the path_provider obtained from the flutter pub site. that solved my issue