首页 > 解决方案 > 错误:指定的语言版本太高。支持的最高语言版本是 2.8。在android studio中我该如何解决?

问题描述

切换到分支“稳定”颤振通道后

以下是构建问题。

错误:指定的语言版本太高。支持的最高语言版本是 2.8。

output: ../../third_party/dart/third_party/pkg/collection/lib/src/utils.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.8.
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
^
../../third_party/dart/third_party/pkg/collection/lib/src/wrappers.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.8.
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
^
../../third_party/dart/third_party/pkg/collection/lib/src/functions.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.8.
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
^

标签: android-studioflutterdartversionflutter-channel

解决方案


为什么?

发生这种情况是因为您指定的语言版本高于.dart_tool目录中声明的版本(特别是在package_config.json文件中)。

解决方案

您可以手动删除该文件夹,也可以让 Flutter 工具为您完成。从终端运行flutter clean,或者,如果使用 Android Studio,请转到Tools -> Flutter -> Flutter Clean.


推荐阅读