Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 861
Jalal Akram Avatar asked Mar 04 '21 20:03

Jalal Akram


5 Answers

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

To downgrade your flutter (Master channel):

flutter downgrade 1.22.6
like image 183
Talha Avatar answered Oct 17 '22 01:10

Talha


You can try to add dependency_overrides to resolve this conflicts :

dependency_overrides:
 intl: "<0.17.0"
like image 39
Witoldio Avatar answered Oct 17 '22 01:10

Witoldio


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.

like image 2
lordvidex Avatar answered Oct 16 '22 23:10

lordvidex


Downgrade flutter using flutter downgrade version

like image 1
Nirmal Vora Avatar answered Oct 17 '22 00:10

Nirmal Vora


my solution for this issue..

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

like image 1
BIS Tech Avatar answered Oct 17 '22 00:10

BIS Tech