=2.14.0 <" /> =2.14.0 <" /> =2.14.0 <"/>

flutter requires SDK version, but version is correctly installed

3.9k Views Asked by At
$fvm flutter run 
Running "flutter pub get" in flutterweb...                      
The current Dart SDK version is 2.13.4.

Because flutterweb requires SDK version >=2.14.0 <3.0.0, version solving failed.

I have this error.

Hoever --version is 2.14.2

$ dart --version
Dart SDK version: 2.14.2 (stable) (Wed Sep 15 12:32:06 2021 +0200) on "macos_x64"

in pubspec.yaml

environment:
  sdk: ">=2.14.0 <3.0.0"

Where should I check??

2

There are 2 best solutions below

1
Nhan Trinh On BEST ANSWER

I did it this way: Open the cmd as Administrator, and run:

flutter upgrade

This works for me.

Code at cmd

1
Mayank On

Which Flutter version are you using? 2.5?

Because different flutter versions require different dart versions. You should try flutter upgrade and if that doesn't fix it, try flutter channel stable.