gpt4 book ai didi

Dart 版本是 2.2.0,但我收到要求版本 >=2.2.0 的错误

转载 作者:IT老高 更新时间:2023-10-28 12:36:45 24 4
gpt4 key购买 nike

我有最新版本的 Flutter,我正在尝试运行官方的 Flutter 图库应用。当我做 dart --version 我得到

Dart VM version: 2.2.0 (Tue Feb 26 15:04:32 2019 +0100) on "macos_x64"

但是,当我尝试获取包裹时:

[flutter_gallery] flutter packages get
Running "flutter packages get" in flutter_gallery...
The current Dart SDK version is 2.1.2-dev.0.0.flutter-0a7dcf17eb.

Because flutter_gallery requires SDK version >=2.2.0 <3.0.0, version solving failed.
pub get failed (1)
exit code 1

有趣的是,当我运行 flutter upgrade 时,它会列出旧版本的 Dart(工具)。

Upgrading Flutter from /Users/leejohnson/dev/flutter...
From https://github.com/flutter/flutter
a1bee54fd..59ce7d6bf dev -> origin/dev
55a2ee588..f8f2b043e master -> origin/master
* [new tag] v1.3.13 -> v1.3.13
Already up to date.

Upgrading engine...
Already up-to-date.

Flutter 1.2.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8661d8aecd (5 weeks ago) • 2019-02-14 19:19:53 -0800
Engine • revision 3757390fa4
Tools • Dart 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

如果我正确理解了这个错误,Flutter 没有使用最新版本的 Dart,但官方 Flutter 示例应用程序需要它。我该如何解决这个问题?

最佳答案

dart --version 的输出与 Flutter 完全无关。你需要检查的是 flutter doctor -vflutter --version。在您的情况下,它显示 Tools • Dart 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

您可能需要切换到另一个 channel ,直到下一次稳定 channel 更新

flutter channel dev

flutter channel master

关于Dart 版本是 2.2.0,但我收到要求版本 >=2.2.0 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55247424/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com