Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install new flutter packages because of incompatible packages that cannot be upgraded

Tags:

flutter

dart

I am trying to install the uuid and shared_preference packages in my flutter application, but I have three packages (meta, web and material_color_utilites) pacakges that are outdated and I cannot update them.

These are the current versions of the packages: http: ^1.1.0 uuid: ^4.2.1 shared_preferences: ^2.2.2 material_color_utilities: ^0.5.0 meta: ^1.10.0 web: ^0.3.0

This is my flutter version: Flutter 3.16.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision db7ef5bf9f (2 days ago) • 2023-11-15 11:25:44 -0800 Engine • revision 74d16627b9 Tools • Dart 3.2.0 • DevTools 2.28.2

When I run flutter pub get or flutter pub upgrade --major-versions I get this error:

Resolving dependencies... (1.7s)
  material_color_utilities 0.5.0 (0.8.0 available)
  meta 1.10.0 (1.11.0 available)
  web 0.3.0 (0.4.0 available)
No dependencies changed.
3 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.

When I run flutter pub outdated I get this message:

Showing outdated packages.
[*] indicates versions that are not the latest available.

Package Name              Current  Upgradable  Resolvable  Latest  

direct dependencies:     
material_color_utilities  *0.5.0   *0.5.0      *0.5.0      0.8.0   
meta                      *1.10.0  *1.10.0     *1.10.0     1.11.0  
web                       *0.3.0   *0.3.0      *0.3.0      0.4.0   

dev_dependencies: all up-to-date.
You are already using the newest resolvable versions listed in the 'Resolvable' column.
Newer versions, listed in 'Latest', may not be mutually compatible.

And if I try to change the versions of the packages manually in the pubspec.yaml file I get this error:

Resolving dependencies... 
Note: web is pinned to version 0.3.0 by flutter_test from the flutter SDK.
See https://dart.dev/go/sdk-version-pinning for details.


Because every version of flutter_test from sdk depends on web 0.3.0 and screen_frontend depends on
  web ^0.4.0, flutter_test from sdk is forbidden.
So, because screen_frontend depends on flutter_test from sdk, version solving failed.


You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on web: flutter pub add web:^0.3.0
like image 998
pypDeveloper Avatar asked Oct 11 '25 23:10

pypDeveloper


2 Answers

flutter pub outdated it says there are outdated packages in you project ,you need to update it

run this command ,

flutter pub upgrade --major-versions
like image 86
Ashok Kmr Avatar answered Oct 14 '25 15:10

Ashok Kmr


Something close to that.

run: flutter update-packages --force-upgrade

https://github.com/dart-lang/sdk/wiki/Flutter-Pinned-Packages

https://github.com/flutter/flutter/blob/master/packages/flutter/pubspec.yaml

like image 23
Falkner SPiT Avatar answered Oct 14 '25 16:10

Falkner SPiT