shared_preferences in Flutter. 10 packages have newer versions incompatible with dependency constraints

67 views Asked by At

enter image description hereWhen installing shared_preferences I get an error in the terminal that says 10 packages have newer versions incompatible with dependency constraints. Now I can't save data. How do I fix it? thanks.

2

There are 2 answers

5
Mehedi Hasan On

Run the commands from your project root directory:

  1. flutter pub outdated
  2. flutter pub upgrade or flutter pub upgrade --major-versions

This should solve the problem.

0
sandy grover On

You can use

Try `flutter pub outdated` for more information.

and

flutter pub upgrade --major-versions
flutter clean
flutter pub get

for reference go through this