问题
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