Question

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

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
^
 46  37608  46
1 Jan 1970

Solution

 34

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.

2020-11-13

Solution

 3

In my case, I had Flutter and Dart installed seperately

  1. Dart(Flutter) - v2.19.2
  2. Dart - v2.17.6

When I run dart command, it uses 2.Dart, which is outdated I removed by brew uninstall dart, and after restarting terminal, it uses flutter dart instead of dart which is latest version

2023-02-22