Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
^
like image 690
J L Avatar asked Jul 30 '20 22:07

J L


2 Answers

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.

like image 190
Michal Karbownik Avatar answered Sep 28 '22 07:09

Michal Karbownik


Cause

One of your packages in pubspec.yaml is requiring dart version up that you have installed. For example, I face this issue withe analyzer package. In my pubspec

analyzer: ˆ3.3.1

So I ve run

flutter version
Answer
Tools • Dart 2.13.3

But as you can see here version 3.3.1 require Dart Tools 2.14

enter image description here

Solution

Discover which package version in incompatible with your dart

like image 24
Frederico Fiuza Avatar answered Sep 19 '22 22:09

Frederico Fiuza