32

Because every version of flutter_localizations from SDK depends on intl 0.17.0 and fstore depends on intl ^0.16.1, flutter_localizations from SDK is forbidden.

So, because fstore depends on flutter_localizations any from SDK, version solving failed. pub get failed (1; So, because fstore depends on flutter_localizations any from sdk, version solving failed.)

EKRAMUL
  • 321
  • 1
  • 3
  • 5
  • Can you explain what are you trying to do? – TDN Mar 04 '21 at 15:49
  • 9
    ok, this is not the solution. but a temporary one. This must have happened after you upgraded to flutter 2 or switched to master channel. It is because the flutter now has null Safety and lost of plugins have not updated yet. And this must have happened on a already existing project. Switch back to stable channel using "flutter channel stable" and downgrade to 1.22.6 by typing "flutter downgrade". FYI : you can try add this to pubspec.yaml. but it might not work some times. dependency_overrides: intl: 0.17.0-nullsafety.2 – Thivanka Sarathchandra Mar 06 '21 at 21:57

8 Answers8

19

I had the same issue, I had to use ***

dependency_overrides

*** and resolve the issue

dependency_overrides:
  intl: any
Eng Mghase
  • 524
  • 6
  • 14
  • Although it's a hack and shouldn't be used in production, it does the job to run the app in certain circumstances. Thank you! – Konstantin Kozirev Jul 05 '23 at 10:45
  • Could you please say more ? Why it is a hack (of course it downgrades the intl to the compatible version but when the versions will be compatible again the latest version will be fetched, will it not ?) What circumstances ? Thanks for your precisions – yohann belhassen Aug 16 '23 at 11:02
  • The dependency_override allows your package to use the associated packages code from your local disk rather than from pub.dev. – Eng Mghase Aug 16 '23 at 12:21
12

Did you try to force package update with

flutter update-packages --force-upgrade

I had the same issue and after updating packages I was able to install flutter_localizations.

Solution found on this github issue https://github.com/flutter/flutter/issues/117163

Dario Corno
  • 1,129
  • 11
  • 19
6

You can check this link it helped me a lot

https://medium.com/swlh/convert-your-flutter-app-to-enjoy-null-safety-69632aa62d7a

Although it was claimed that null safety is an opt-in feature, a fresh install still somehow forced me to upgrade my dependency. Anyway, I was glad that the error message was very useful and the change seemed easy. So, I replaced the line:

intl: ^0.16.1

with

intl: ^0.17.0-nullsafety.2

Now my % flutter pub get was clean and the app worked fine without any changes. That’s great! For any kind of migration exercise, it is always a good idea to start with a working baseline.

H Amr
  • 177
  • 1
  • 13
2

This solved it. Edit your pubspec.yaml as below

  dependencies:
    flutter:
      sdk: flutter
    ...
    ...
    # Add localization as below
    flutter_localizations:
      sdk: flutter
    intl: any
Aashis Shrestha
  • 342
  • 5
  • 13
1

In my case, I used flutter 1 and the dependency version belongs to flutter 2.

Use the Not Null safety versions.

Gayan Chinthaka
  • 521
  • 6
  • 5
0

Just override the dependency

dependency_overrides:
    intl: 0.17.0
Pankaj Jangid
  • 121
  • 1
  • 6
0

Update Flutter to new version to compatible with new intl package.

enter image description here

Doan Bui
  • 3,572
  • 25
  • 36
0

Because every version of flutter_sheet_localization_generator from git depends on intl ^0.17.0 and every version of flutter_localizations from sdk depends on intl 0.18.1, flutter_sheet_localization_generator from git is incompatible with flutter_localizations from sdk.

Rein
  • 61
  • 1
  • 5