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

17,159

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.

Share:
17,159

Related videos on Youtube

J L
Author by

J L

Updated on June 04, 2022

Comments

  • J L
    J L almost 2 years

    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
    ^
    
    • Christopher Moore
      Christopher Moore over 3 years
      Post error messages and your question directly into the body. Additionally, share your pubspec.yaml.
    • J L
      J L over 3 years
      I added the pubspec.yaml as an image
    • Christopher Moore
      Christopher Moore over 3 years
      Post error messages and your question directly into the body of your question using the formatting tools provided and share the output of flutter channel.
    • wqyfavor
      wqyfavor over 3 years
    • Ali Haider
      Ali Haider over 3 years
      I was facing the same problem. Simply use 'flutter clean' and then the 'flutter run' command, and all the problems are resolved automatically.
    • Aravind Siruvuru
      Aravind Siruvuru over 3 years
      please do try "flutter clean" and then "flutter run" before you do any unnessasary steps... It worked for me ...
    • kris
      kris over 3 years
      I've voted to reopen this - while it appears to be a specific configuration issue, this error can come about from a more general situation of Flutter channel being messed up. If I could add an answer it would be to do the following (which just fixed this for me) : 1. flutter --version # check version, 2. flutter channel stable, 3. flutter upgrade
  • J L
    J L over 3 years
    Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.18363.959], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [√] Android Studio (version 3.6) [√] VS Code (version 1.47.3)
  • J L
    J L over 3 years
    [√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18363.959], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.1) [√] Android Studio (version 4.0) [√] VS Code (version 1.47.3) [√] Connected device (1 available)
  • J L
    J L over 3 years
    I updated the version - same error message accross the flutter project apps.ERROR: Could not find method android() for arguments [build_1rg1v59oeriv4kmihpnqlgtzy$_run_closure1$_closure3$_cl‌​osure4@d963f4d] on project ':@react-native-community_async-storage' of type org.gradle.api.Project.
  • Nouredine LAMAMRA
    Nouredine LAMAMRA over 3 years
    firstly, try create a new project(simple flutter project) , run it and see if there is an error or it works. post comment when its done
  • J L
    J L over 3 years
    Hi, the issue seems to be in Android Studio where I cannot find the issue. I connected the emulator to my VS codes and it works. thanks @Noreddine Doudine Lam for your help.
  • waleed.makarem
    waleed.makarem over 3 years
    I had same issue. juse goto Tools, flutter >> flutter clean, then run the project. It should work isa.
  • Gabu
    Gabu over 3 years
    @waleed.makarem thanks, your solution worked. You should post it as the answer.
  • akshitmahajan
    akshitmahajan over 3 years
    Thanks for the answer, solved my issue by following these steps. Should be marked as correct answer.
  • Paul Stoner
    Paul Stoner about 3 years
    I realize this is an older post, but I'm confused about the comparison of the version of flutter to the version in the pubspec.yaml. From the Dart Docs indicate the version in the pubspec is for your package and not the version of flutter. Am I mistaken?