Flutter SDK versions not lining up, won't work on emulator - Stack Overflow

admin2025-03-19  4

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

Share Improve this question asked Nov 20, 2024 at 0:48 Patrick BowmanPatrick Bowman 1
Add a comment  | 

1 Answer 1

Reset to default 0

There should be several reasons for your app to be troubled.

  1. VSCode's flutter path doesn't match your local flutter path added to the environmental path. If you are using 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.
  2. 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.
  3. Your project 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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1742387937a211084.html

最新回复(0)