leoafarias/fvm

Flutter 3.19.1 uses dart 3.2.5 instead of 3.3.0

emreakcan opened this issue · 3 comments

Before creating a bug report please make check the following

  • You have read our FAQ
  • If you have used flutter. Please install correctly, run pub cache repair. Close the terminal and try again.
  • [] If you are on Windows. Make sure you are running the terminal as administrator or with developer permissions.
  • Run fvm doctor if possible and add the output to the issue.

Describe the bug
Using flutter 3.19.1, but fvm uses dart 3.2.5, should be using 3.3.0

To Reproduce
Install newest fvm 3.0.11, run fvm use 3.19.1, observe fvm dart --version

Expected behavior
Should be using dart 3.3.0

Logs

emre@Emres-MacBook-Pro-2  % fvm --version
3.0.11

emre@Emres-MacBook-Pro-2 % fvm flutter --version
Flutter 3.19.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 67457e669f (6 weeks ago) • 2024-01-16 16:22:29 -0800
Engine • revision 6e2ea58a5c
Tools • Dart 3.3.0 • DevTools 2.28.5

emre@Emres-MacBook-Pro-2  % fvm dart --version
Dart SDK version: 3.2.5 (stable) (Tue Jan 16 15:02:13 2024 +0000) on "macos_arm64"

emre@Emres-MacBook-Pro-2  % fvm flutter pub get
Resolving dependencies... 
The current Dart SDK version is 3.2.5.

Because project requires SDK version >=3.3.0 <4.0.0, version solving failed.
You can try the following suggestion to make the pubspec resolve:
* Try using the Flutter SDK version: 3.19.1. 

Desktop (please complete the following information):

  • OS: [Mac OS silicon]
  • FVM Version [3.0.11]

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.1, on macOS 14.1.2 23B92 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[!] Android Studio (version unknown)
    ✗ Unable to determine Android Studio version.
[✓] Android Studio (version 2023.1)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.
Screenshot 2024-02-26 at 12 26 12 Screenshot 2024-02-26 at 12 26 58

@emreakcan can you provide the output for fvm doctor?

@emreakcan I believe the issue is the following:

If you run

fvm --verbose flutter --version

You probably see that fvm is running the Flutter SDK from PATH, because there is no version configured in the project folder.

Which means if you run

fvm --verbose dart --version

It means that it will run the Dart version that is configured in the PATH, which is not the one in Flutter.

If that is the case, then this is not a "bug" as it is behaving correctly, however I think we might do an enhancement for this, where it might be more logical to use the dart version of the flutter SDK path.

Will close this, and have added as part of an iprovement on issue #648