0

I have upgraded the flutter version to the latest (2.5.2). when I upgrade, some dependencies also upgraded. but some of them are not compatible with null-safe.

SDK version is (2.5.2),

sdk: ">=2.12.0 <3.0.0"

suggest versions (only incompatible versions),

Package Name                 Current    Upgradable  Resolvable  Latest

direct dependencies:
date_range_picker            ✗1.0.7     -           -           ✗1.0.7
flushbar                     ✗1.10.4    -           -           ✗1.10.4
flutter_statusbarcolor       ✗0.2.3     -           -           ✗0.2.3
latlong                      ✗0.6.1     -           -           ✗0.6.1

An error was occurring when running pub get without upgrading those dependencies,

Running "flutter pub get" in mobileapp...                  
Because no versions of latlong match >0.6.1 <0.7.0 and latlong 0.6.1 depends on logging >=0.11.3 <1.0.0, latlong ^0.6.1 requires logging >=0.11.3 <1.0.0.
And because json_serializable >=4.0.3 depends on build ^2.0.0 which depends on logging ^1.0.0, latlong ^0.6.1 is incompatible with json_serializable >=4.0.3.
So, because mobileapp depends on both json_serializable ^6.0.0 and latlong ^0.6.1, version solving failed.
pub get failed (1; So, because mobileapp depends on both json_serializable ^6.0.0 and latlong ^0.6.1, version solving failed.)
Process finished with exit code 1

is there any solution to solve those dependencies issues?

Tharindu Lakshan
  • 3,995
  • 6
  • 24
  • 44
  • A dependency override might help, take a look [here](https://stackoverflow.com/questions/69137096/the-argument-type-pointerevent-cant-be-assigned-to-the-parameter-type-pointe/69138919#69138919) – croxx5f Oct 15 '21 at 06:30
  • should I add those dependencies to both places? (dependencies & dependency_overrides) ? – Tharindu Lakshan Oct 15 '21 at 06:37
  • Thank you @croxx5f. anyway, I overrode them, but the above issue is still occurring. :| – Tharindu Lakshan Oct 15 '21 at 06:38
  • Probably a dependency override of `logging: ^1.0.0` could be enough. It's a tricky business nonetheless as the API could have changed – croxx5f Oct 15 '21 at 06:39
  • I have one more question. why suggested versions are not showing ``Upgradable`` and ``Resolvable`` versions? Isn't it upgradable? – Tharindu Lakshan Oct 15 '21 at 06:51
  • 1
    Because given the constraints the version of the packages you use have. There are no resolvable updates. It might be because the package did not updated to null safety or just because as it already happened to you two packages require different versions of a third dependency. Did you manage to run your app? – croxx5f Oct 15 '21 at 07:12

0 Answers0