I'm currently on Flutter 3.29.0 and planning to upgrade to the latest stable release of the Flutter SDK. I'm using FVM 3.2.1. Before using the latest stable version of the Flutter SDK, I checked first the FVM list of Flutter SDK releases that are supported by running fvm releases
:
Since I've already installed Flutter 3.32.0 (because the Flutter team released this as initial stable release) and Flutter 3.32.5 using FVM, I move on to the next step (executing either of the commands):
fvm use 3.32.0
or
fvm use 3.32.5
However, I get this error:
Note: intl is pinned to version 0.20.2 by flutter_localizations from the flutter SDK. See https://dart.dev/go/sdk-version-pinning for details.
Because my_project depends on flutter_localizations from sdk which depends on intl 0.20.2, intl 0.20.2 is required. So, because my_project depends on intl ^0.19.0, version solving failed.
You can try the following suggestion to make the pubspec resolve:
- Try upgrading your constraint on intl: flutter pub add intl:^0.20.2
Failed to update packages.
It also asked me this:
Would you like to continue pinning this version anyway? · no
But I choose no
.
And then, this message prints:
Dependencies not resolved.
Additionally, running this command (but before that, I needed to remove the existing intl: ^0.19.0
first), then:
flutter pub add intl:^0.20.2
And then it prints this message:
Note: intl is pinned to version 0.19.0 by flutter_localizations from the flutter SDK. See https://dart.dev/go/sdk-version-pinning for details.
Because my_project depends on flutter_localizations from sdk which depends on intl 0.19.0, intl 0.19.0 is required. So, because my_project depends on intl 0.20.2, version solving failed.
Failed to update packages.
Moreover, in my pubspec.yaml
file:
dependencies:
flutter:
sdk: flutter
flutter_web_plugins:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.19.0
intl_utils: ^2.8.8
intl_translation: ^0.20.1
# ... other configurations here
These are my following questions about this issue:
I didn't expect that to happen, but I resolved the issue with a workaround. Here are the steps I took to fix it:
In the pubspec.yaml
file, add this:
dependency_overrides:
intl: ^0.19.0
And then I upgraded the intl
dependencies:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.20.2
# other dependencies here...
Note that I removed intl_translation
because I am not using it, but it depends on your use case, particularly if you are still using it.
After that, execute these commands (optional, but recommended):
flutter clean; flutter pub get;
With the given simple steps above, I successfully executed:
fvm use 3.32.0
Here's the portion of the results from fvm doctor
:
However, as of this writing, I just found out that the currently stable version of Flutter is 3.32.8
.
By executing fvm releases
:
Therefore, I needed to execute fvm use 3.32.8
instead, and it executed properly.