Jalal Akram
Jalal Akram

Reputation: 119

Flutter 2.0 upgrade, pub get failed with nonsense dependency behavior

The project was working like a charm that started issues after the upgrade to flutter 2.0. following are errors upon pub get.

[delivered] flutter pub get
Running "flutter pub get" in delivering...     
Because every version of flutter_localizations from sdk depends on intl 0.17.0 and firebase_auth_web >=0.3.0-dev.1 <0.4.0-1.0.nullsafety.0 depends on intl ^0.16.1, flutter_localizations from sdk is incompatible with firebase_auth_web >=0.3.0-dev.1 <0.4.0-1.0.nullsafety.0.
Because firebase_auth >=0.18.4 <=0.18.4 depends on firebase_auth_web ^0.3.2+2 and firebase_auth ^0.18.4+1 depends on firebase_auth_web ^0.3.2+3, firebase_auth ^0.18.4 requires firebase_auth_web ^0.3.2+2.
Thus, flutter_localizations from SDK are incompatible with firebase_auth ^0.18.4.
So, because iDelivered depends on both flutter_localizations any from SDK and firebase_auth ^0.18.4, version solving failed.
pub get failed (1; So, because delivered depends on both flutter_localizations any from SDK and firebase_auth ^0.18.4, version solving failed.)
exit code 1

Here is my pubspec.yaml for reference:

version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

  google_fonts: ^1.1.1

  http: ^0.12.2
  shared_preferences: ^0.5.12+4

  firebase_core: ^0.5.3
  firebase_auth: ^0.18.4
  cloud_firestore: ^0.14.4
  firebase_messaging: ^7.0.3

  parse_server_sdk_flutter: ^2.1.0

  place_picker: ^0.9.16
  google_maps_flutter: ^1.0.6

  animations: ^1.1.2
  flutter_slidable: ^0.5.7

Upvotes: 11

Views: 6250

Answers (6)

BIS Tech
BIS Tech

Reputation: 19424

my solution for this issue..

download both 2.0.2 flutter SDK and 1.22.6 flutter SDK. change flutter SDK project-wise.

Upvotes: 1

Ping Woo
Ping Woo

Reputation: 1773

In my app,

  1. I upgrade following three pubs to latest
  firebase_analytics: ^7.1.1,
  firebase_core: ^1.0.1,
  firebase_messaging: ^9.0.0
  1. I downgrade google mobile ads SDK to 7.6.9 in IOS pod file, it works for me. https://github.com/FirebaseExtended/flutterfire/issues/4931

Upvotes: 0

Witoldio
Witoldio

Reputation: 951

You can try to add dependency_overrides to resolve this conflicts :

dependency_overrides:
 intl: "<0.17.0"

Upvotes: 2

Talha
Talha

Reputation: 12719

My suggestion is for a few week don't update your flutter version

To downgrade your flutter (Master channel):

flutter downgrade 1.22.6

Upvotes: 12

Nirmal Vora
Nirmal Vora

Reputation: 9

Downgrade flutter using flutter downgrade version

Upvotes: 1

lordvidex
lordvidex

Reputation: 4068

Since you upgraded to Flutter 2.0, the flutter sdk is the source of the flutter_localizations. So, you have to upgrade your firebase dependencies e.g. firebase_auth, firebase_core to at least version 1.0.0.

My advice is that if the packages you are using have not been upgraded to null-safety OR they have not been recently updated, you should just stick to the 1.22.6 stable version of flutter for now.

Upvotes: 2

Related Questions