Error: The specified language version is too high. The highest supported language version is 2.8. in android studio how can I fix it?

情到浓时终转凉″ 提交于 2020-12-30 06:09:16

问题


After switched to branch 'stable' flutter channel

The following is the build issue.

Error: The specified language version is too high. The highest supported language version is 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
^

回答1:


Why?

This happens, because the your specified language version is higher than the one declared in the .dart_tool directory (specifically in the package_config.json file).

Solution

You can either delete the folder manually or let Flutter tools do it for you. Run flutter clean from the terminal or, if using Android Studio, go to Tools -> Flutter -> Flutter Clean.




回答2:


I had the same error yesterday and I fixed it.

This error came when you switch the version of flutter from 1.17.5 (stable channel) to 1.20.? (dev channel).

To fix it, just create a new project using the last version installed on your PC and copy & paste all the files.

The problem come from the pubspec.lock file because of the versions.

So as conclusion, if you changed the version of flutter just create another project and copy the necessary files.




回答3:


run flutter clean flutter --version command on terminal

check the flutter version for example here is 1.22.5 in pubspec.yml change the version to the updated version



来源:https://stackoverflow.com/questions/63182015/error-the-specified-language-version-is-too-high-the-highest-supported-languag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!