Flutter 2 upgrade dependencies failed

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 upgrade dependencies failed. 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 upgrade dependencies failed ?

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 upgrade dependencies failed ?

Question: How To Solve Flutter 2 upgrade dependencies failed ?
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.

Solution 1

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 :

  1. Open pubspec.yaml file.
  2. Just add dependency_overrides below dev_dependencies.
  3. run pub get.
  4. That’s It.

Here Is Sample Code for pubspec.yaml

dependency_overrides:
  plugin_platform_interface: '>=2.0.0'
  intl: '>=0.17.0'
  rxdart: '>=0.26.0'

This solution worked for me. Comment below if work for you also.

Solution 2

My suggestion is for a few week don’t update your flutter version
To downgrade your flutter (Master channel):

flutter downgrade 1.22.6

Summery

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

Milan Dhameliya is an Information Technology Engineer. By profession, he is a Full Stack developer with knowledge of multiple back-end platforms (e.g., PHP, Node.js, Python) and frontend Flutter frameworks.

Leave a Comment