【问题标题】:Error: The specified language version is too high. The highest supported language version is 2.13错误:指定的语言版本太高。支持的最高语言版本为 2.13
【发布时间】:2021-12-01 07:23:59
【问题描述】:

出于某种原因,我将 Flutter 从 2.5.2 降级到 2.2.3。

现在:Flutter version 2.2.3Dart version 2.13.4

在 pubspec.yaml 中:

environment:
  sdk: ">=2.12.0 <3.0.0"

当我运行项目时,它可以工作,但我从控制台收到此消息:

Failed to precompile devtools:devtools:
/C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/shelf_proxy-1.0.1/lib/shelf_proxy.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.13.
// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
^
/C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http-0.13.4/lib/http.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.13.
// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
^
/C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/client.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.13.
// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
^
/C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/exception.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.13.
// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
^
/C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/request.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.13.
// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
^
/C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/response.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.13.
// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
^
/C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/streamed_request.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.13.
// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
^
/C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/base_client.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.13.
// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
^
/C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/base_request.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.13.
// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
^
/C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/base_response.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.13.
// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
^

Here 就是它所说的:“flutter clean,然后运行项目。”它不能解决问题。

我该如何解决这个问题?

【问题讨论】:

标签: flutter dart


【解决方案1】:

解决方案 1

删除pubspec.lock文件。

然后运行,

flutter clean

flutter pub get

解决方案 2

flutter pub cache repair

免责声明:运行上述命令时,互联网连接速度非常快,否则会浪费数小时的生产时间。 (这将重新下载安装在您电脑上的每个包,我的意思是每个包的每个版本)

【讨论】:

  • 不幸的是它没有修复它。我仍然收到同样的信息。
  • @zeed 检查第二个解决方案
  • 解决方案 2 有效,谢谢。我希望您在运行代码之前发出警告。哈哈。在看到其他人的这个答案后,我认为指出该过程将需要很长时间才能运行代码会很有用,如here
  • @zeed,不客气。哈哈。好主意。我添加了免责声明。
  • 我遇到了同样的问题,但在我的情况下,解决方案 1 和 2 都不起作用:/
猜你喜欢
  • 2020-11-20
  • 1970-01-01
  • 1970-01-01
  • 2020-07-08
  • 2021-04-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多