New guy here...I'm trying to start a new Flutter project. After I do that, and I try to launch the emulator, I get an error saying I have a different version of flutter running than what the project is compatible with and what Flutter --version shows.
Error: The current Dart SDK version is 3.3.3.
Because no versions of flutter_lints match >5.0.0 <6.0.0 and flutter_lints 5.0.0 requires SDK version ^3.5.0, flutter_lints ^5.0.0 is forbidden.
Current version: Flutter 3.24.5 • channel stable • .git Framework • revision dec2ee5c1f (6 days ago) • 2024-11-13 11:13:06 -0800 Engine • revision a18df97ca5 Tools • Dart 3.5.4 • DevTools 2.37.3
I've tried every solution I could find here, YT etc.
I tried Flutter upgrade, flutter channel stable, changing the Flutter folder with one from pub.dev. It doesn't seem that any of these solutions updated the flutter sdk tied to VS Code
New guy here...I'm trying to start a new Flutter project. After I do that, and I try to launch the emulator, I get an error saying I have a different version of flutter running than what the project is compatible with and what Flutter --version shows.
Error: The current Dart SDK version is 3.3.3.
Because no versions of flutter_lints match >5.0.0 <6.0.0 and flutter_lints 5.0.0 requires SDK version ^3.5.0, flutter_lints ^5.0.0 is forbidden.
Current version: Flutter 3.24.5 • channel stable • https://github/flutter/flutter.git Framework • revision dec2ee5c1f (6 days ago) • 2024-11-13 11:13:06 -0800 Engine • revision a18df97ca5 Tools • Dart 3.5.4 • DevTools 2.37.3
I've tried every solution I could find here, YT etc.
I tried Flutter upgrade, flutter channel stable, changing the Flutter folder with one from pub.dev. It doesn't seem that any of these solutions updated the flutter sdk tied to VS Code
There should be several reasons for your app to be troubled.
fvm
to manage flutter versions, please make sure the VSCode and environmental path to point the fvm/default/bin
.
If you are not using fvm
and just using flutter manually, please check if you have downloaded several versions of flutter and paths from VSCode and environmental variables pointing differently.Dart
SDK path could be different from Flutter path.
Flutter SDK has Dart
SDK in its source. But we often install extra Dart SDK and environment path or dart path of VSCode points that extra Dart SDK path.
So check your path variables and if you are using extra Dart SDK, remove it and correct it to point the Dart path inside of Flutter.pubspec.yaml
should be pointing to the lower version of Flutter.
Please check your pubspec.yaml
and make it sure to be matching to your local flutter SDK version.
And if you are using fvm
, please make a call fvm use 3.24.5
on your project terminal.PS.
You can find VSCode's flutter path in Settings/Extensions/Dart/Flutter
.