我试图在我的flutter应用程序中安装uuid和shared_preference包,但我有三个包(Meta,web和material_color_utilites)已经过时,我无法更新它们。
以下是软件包的当前版本: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
这是我的Flutter版本: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
当我运行flutter pub get
或flutter pub upgrade --major-versions
时,我得到这个错误:
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.
字符串
当我运行flutter pub outdated
时,我得到以下消息:
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.
型
如果我尝试在pubspec.yaml文件中手动更改软件包的版本,我会得到这个错误:
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
型
1条答案
按热度按时间ca1c2owp1#
flutter pub outdated
它说你的项目中有过时的软件包,你需要更新它运行此命令,
字符串