Flutter pub get version 解决失败
Flutter pub get version solving failed
我遇到了 flutter pub get 的问题,尝试更新 dart sdk,重启电脑以将 Dart sdk 位置添加回环境变量,删除 .git 文件夹。
Running "flutter pub get" in calculator...
The current Dart SDK version is 2.13.4.
Because calculator depends on webview_flutter >=2.0.14 which requires SDK version >=2.14.0 <3.0.0, version solving failed.
pub get failed (1; Because calculator depends on webview_flutter >=2.0.14 which requires SDK version >=2.14.0 <3.0.0, version solving failed.)
exit code 1
颤振医生:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [version 10.0.19043.1288], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.0)
[√] VS Code (version 1.61.2)
[√] Connected device (3 available)
飞镖版本:
Dart SDK version: 2.14.4 (stable) (Wed Oct 13 11:11:32 2021 +0200) on "windows_x64"
将 pubspec.yaml 中 webview_flutter 的版本更改为
webview_flutter: any
当您说您尝试更新 Dart SDK 时,您是否也更新了 pubspec.yaml
?
environment:
sdk: ">=2.14.0 <3.0.0"
尝试删除 pubspec.lock 然后重试
更新Dart Sdk并重启电脑后问题解决了。
即使在这两个步骤之后我仍然遇到相同的错误,所以我将 any
放在 pubspec.yaml
和 运行 flutter pub get
之前的包值中,我关闭了我的杀毒软件。
尝试
flutter upgrade
对我有用。
我遇到了 flutter pub get 的问题,尝试更新 dart sdk,重启电脑以将 Dart sdk 位置添加回环境变量,删除 .git 文件夹。
Running "flutter pub get" in calculator...
The current Dart SDK version is 2.13.4.
Because calculator depends on webview_flutter >=2.0.14 which requires SDK version >=2.14.0 <3.0.0, version solving failed. pub get failed (1; Because calculator depends on webview_flutter >=2.0.14 which requires SDK version >=2.14.0 <3.0.0, version solving failed.) exit code 1
颤振医生:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [version 10.0.19043.1288], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.0)
[√] VS Code (version 1.61.2)
[√] Connected device (3 available)
飞镖版本:
Dart SDK version: 2.14.4 (stable) (Wed Oct 13 11:11:32 2021 +0200) on "windows_x64"
将 pubspec.yaml 中 webview_flutter 的版本更改为
webview_flutter: any
当您说您尝试更新 Dart SDK 时,您是否也更新了 pubspec.yaml
?
environment:
sdk: ">=2.14.0 <3.0.0"
尝试删除 pubspec.lock 然后重试
更新Dart Sdk并重启电脑后问题解决了。
即使在这两个步骤之后我仍然遇到相同的错误,所以我将 any
放在 pubspec.yaml
和 运行 flutter pub get
之前的包值中,我关闭了我的杀毒软件。
尝试
flutter upgrade
对我有用。