Hello Guys How are you all? Hope You all are fine. When I try to upgrade my flutter app to flutter 2.0. I am Facing an Error. Flutter 2.0 upgrade, pub get failed with nonsense dependency behavior. So today Here I come with all possible solutions for this error.
We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.
How Flutter 2.0 upgrade, pub get failed with nonsense dependency behavior Occurs ?
I Upgrade My flutter project to flutter latest version 2.0. When I upgrade to flutter 2 and I got this error:
Because geoflutterfire 2.2.1 depends on rxdart ^0.24.1 and no versions of geoflutterfire match >2.2.1 <3.0.0, geoflutterfire ^2.2.1 requires rxdart ^0.24.1.
So, because sample_app depends on both rxdart ^0.26.0 and geoflutterfire ^2.2.1, version solving failed.
pub get failed (1; So, because sample_app depends on both rxdart ^0.26.0 and geoflutterfire ^2.2.1, version solving failed.)
Here is my flutter Doctor output.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.0, on macOS 11.1 20C69 darwin-x64, locale en-IL)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Community Edition (version 2019.1)
[✓] Connected device (2 available)
How To Solve Flutter 2.0 upgrade, pub get failed with nonsense dependency behavior ?
Question: How To Solve Flutter 2.0 upgrade, pub get failed with nonsense dependency behavior ?
Answer: when we update our flutter version we have to override our package. So just add dependency_overrides below your dev_dependencies and dont forgot to mention your package.
When we update our flutter version we have to override our package. So just add dependency_overrides below your dev_dependencies and don’t forget to mention your package. You can try to add dependency_overrides to resolve these conflicts :
- Open pubspec.yaml file.
- Just add dependency_overrides below dev_dependencies.
- run pub get.
- That’s It.
Here Is Sample Code for pubspec.yaml
This solution worked for me. Comment below if work for you also.
My suggestion is for a few week don’t update your flutter version
To downgrade your flutter (Master channel):
flutter downgrade 1.22.6
Just add dependency_overrides to resolve this conflicts :
So it’s all About All possible solutions. Hope this above all solution helped you a lot. Comment below Your thoughts and your queries. Comment Below on your suggestion.
Check Out Below Article
- How to make a blur Background Image effect in Flutter using BackdropFilter.
- Create Rounded Corners Image in Flutter.
- set Background Image to Scaffold in Flutter.
- How To Select multiple images with Flutter
- How to Set Network Image In Circular Avatar In Flutter?