I struggled to fix all the dependencies issues I had after the upgrade.
there is still one regarding
$ flutter pub get
Resolving dependencies...
Because no versions of i18n_extension match >9.0.2 <10.0.0 and i18n_extension 9.0.2 depends on sprintf ^7.0.0, i18n_extension ^9.0.2 requires sprintf ^7.0.0.
And because optimized_cached_image >=3.0.0 depends on sprintf ^6.0.0, i18n_extension ^9.0.2 is incompatible with optimized_cached_image >=3.0.0.
So, because shokaze depends on both i18n_extension ^9.0.2 and optimized_cached_image ^3.0.0, version solving failed.
exit code 1
And here is the yaml (I removed all the unnecessary lines for convenience):
environment:
sdk: '>=2.18.2 <3.0.0'
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.18.0 #^0.17.0
i18n_extension: ^9.0.2 #^5.0.1
optimized_cached_image: ^3.0.0 #^3.0.1
I don't explicitly ask for sprintf
.
How could I solve the dependency issues?
This is a common problem in Flutter, and it's happening because the packages
i18n_extension
andoptimized_cached_image
depend on different versions of thesprintf
package. Specifically,i18n_extension
depends on version^7.0.0
ofsprintf
, whileoptimized_cached_image
depends on version^6.0.0
. This causes a conflict because the two packages require different versions of the same dependency.Here's a few ways to resolve this issue:
Upgrade or downgrade one of the packages - Check the pub.dev listings for
i18n_extension
andoptimized_cached_image
to see if there's a newer version of either package that resolves the dependency conflict. If a newer version isn't available, you might consider downgrading one of the packages if it's compatible with your project.Override the dependency - You can override the
sprintf
version in yourpubspec.yaml
file to use a specific version. This should only be done as a last resort, because it can lead to unexpected behavior if the overridden version isn't compatible with all packages that depend on it. Here's an example of how to do this:sprintf
dependency) and ask the maintainers to update the package to use a version ofsprintf
that's compatible with the other package.Remember to run
flutter pub get
after making changes to yourpubspec.yaml
file to update your dependencies