The specified language version is too high. The highest supported language version is 3.0

802 Views Asked by At

I'm using fvm to use a later version of flutter (3.15.0-15.2.pre) than my global version (3.10.6). I've ran fvm use 3.15.0-15.2.pre and my project is using that.

I have updated my pubspec.yaml with this:

environment:
  sdk: '>=3.1.0 <4.0.0'

flutter 3.15.0-15.2.pre should definitely be using dart > 3.1.

But I'm getting:

Error (Xcode): .dart_tool/flutter_build/dart_plugin_registrant.dart:1:1: Error: The specified language version is too high. The highest supported language version is 3.0

I'm doing everything to make sure it is using fvm dart.

I've run fvm flutter clean, fvm flutter pub get and .fvm/flutter_sdk/bin/flutter run --flavor development --dart-define-from-file "lib/config/environment_strings_dev.json" --target "lib/main_development.dart".

Yet I still get the error.

Is this error not to do with the dart version being too low, but 3.15.0-15.2.pre uses a high enough dart version?

I've seen Error: The specified language version is too high. The highest supported language version is 2.8. in android studio how can I fix it? But deleting the .dart_tool directory doesn't work.

flutter doctor shows my global flutter version not my project version so fvm isn't working.

It runs on the android emulator but not the ios simulator.

2

There are 2 best solutions below

0
odinachi On

In my case, I was able to fix this issue by setting the path to the flutter version I was using on Xcode and you can do this by doing the following

  1. open your project in XCode
  2. Click on your project Target
  3. Click on Build settings
  4. Search for FLUTTER_ROOT and paste the path to flutter there...

Hopefully, This should resolve the issue.

0
Aizan Sagheer On

I had the same issue. I tried all the steps but it didn't help when I checked my pubspec.yaml file I was overriding one dependency as:

dependency_overrides:
   platform: ^3.1.0

I removed it and the error is gone.