dart-lang / i18n

A general mono-repo for Dart i18n and l10n packages.
BSD 3-Clause "New" or "Revised" License
63 stars 38 forks source link

`Version solving failed` for `intl: 0.19.0` #759

Open mosuem opened 10 months ago

mosuem commented 10 months ago

This is a pre-emptive issue thread, as we recently published a new version of package:intl. This results in the following error message, as long as Flutter has not updated their pinned version.

mosuem@mosuem:~/my_app$ flutter pub get
Resolving dependencies... (1.0s)
Note: intl is pinned to version 0.18.1 by flutter_localizations from the flutter SDK.
See https://dart.dev/go/sdk-version-pinning for details.

Because my_app depends on flutter_localizations from sdk which depends on intl 0.18.1, intl 0.18.1 is required.
So, because my_app depends on intl ^0.19.0, version solving failed.

You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on intl: flutter pub add intl:^0.18.1

See https://github.com/dart-lang/sdk/wiki/Flutter-Pinned-Packages for more information.

iKK001 commented 10 months ago

Same here, when will flutter_localizations update to intl 0.19.0 ?

miguelangelflores1993 commented 10 months ago

same problem

AlexDochioiu commented 10 months ago

@mosuem Looking at changelog, 0.19.0 doesn't seem to have any braking changes compared to 0.18.1. Is this correct? Trying to figure out if a dependency override is a good temporary solution.

iKK001 commented 10 months ago

hmm the release of intl 0.18.1 was 12 month ago, the release of intl 0.19.0 was 12 days ago. It is too hard for me to tell if there are breaking changes or not. (it does not seem to - but you have to test). Here the documentation of intl 0.19.0

And here the changelog of intl 0.19.0

Biggest change seems to me the change to Flutter-SDK 3.0.0.

mosuem commented 10 months ago

@mosuem Looking at changelog, 0.19.0 doesn't seem to have any breaking changes compared to 0.18.1. Is this correct? Trying to figure out if a dependency override is a good temporary solution.

If something is a breaking change is hard to say - but a dependency override should be safe and would be my recommended course of action.

Sistem-Pack commented 9 months ago

Up, same problem! image

lukemmtt commented 9 months ago

One data point: I've been using a dependency override to pin intl to 0.19 for weeks in a complex app without issues.

jungwoo-0530 commented 8 months ago

same problem.

because this issue, i've been stopped upgrade packages...

mosuem commented 8 months ago

because this issue, i've been stopped upgrade packages...

Using a dependency override should work, as pointed out in earlier comments.

IAmJulianAcosta commented 7 months ago

@lukemmtt could you please provide some code example?

lukemmtt commented 7 months ago

@IAmJulianAcosta Just put this in your pubspec.yaml:

dependency_overrides:
  intl: 0.19.0
tomasweigenast commented 6 months ago

@IAmJulianAcosta Just put this in your pubspec.yaml:

dependency_overrides:
  intl: 0.19.0

Keep in mind that overriding dependencies in publishable packages is not a good practice and in fact pub will alert you about that.

scopendo commented 6 months ago

Is the problem here that intl package hasn't reached a 1.0.0 release yet and so the bump from 0.18.x to 0.19.x is considered a potential breaking change per semver?

It seems crazy for the solution to be for so many projects to have to add a dependency override. It seems to me that everyone should be able to depend on intl ^1.0.0, including flutter_localizations, and then the incidence of this should be much reduced.

mosuem commented 6 months ago

I think 1.0.0 is not the issue - it would still break on major version revs, which the change to 0.19.0 was. In my opinion, the problem is in the Flutter way of pinning packages and the speed of how fast updates propagate.