You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 dart.changeFlutterSdk not available without global Flutter SDK #6065
🐛 dart.changeFlutterSdk not available without global Flutter SDK
The VS Code command dart.changeFlutterSdk (Change Flutter SDK) is not visible in the Command Palette when Flutter is not installed globally (not present in PATH).
This becomes an issue for setups using FVM, where Flutter is intentionally managed per project and no global Flutter SDK exists.
Steps to reproduce
Do not install Flutter globally
Use a project configured with FVM
Open VS Code
Run Ctrl + Shift + P
Search for “Change Flutter SDK”
Actual behavior
The dart.changeFlutterSdk command does not appear
Expected behavior
The command should be available regardless of a global Flutter installation
Users should be able to select an SDK path (including FVM-managed SDKs)
Workaround
Installing a global Flutter SDK makes the command appear again, after which the SDK can be switched to FVM.
NOTE: I refactored the creation of this issue with CHATGPT. The issue is still the same, just the phrasing is a bit different then when I write it myself.
I have installed a global version of flutter now using FVM global (not the solution what I want) but this show's that it works when there is any flutter installed.
@stan-at-work I checked the code, and this command should always be available as long as we have found a Flutter project in the workspace.
However, startup would stall if we cannot find a Flutter SDK at all. In this case, there should be a notification in the bottom right corner saying we can't find an SDK and asking you to locate one - is that what happens in this case?
If so, you'll need to provide some way for Dart-Code to know what SDK to use to spawn tools from the SDK.
@stan-at-work I checked the code, and this command should always be available as long as we have found a Flutter project in the workspace.
However, startup would stall if we cannot find a Flutter SDK at all. In this case, there should be a notification in the bottom right corner saying we can't find an SDK and asking you to locate one - is that what happens in this case?
If so, you'll need to provide some way for Dart-Code to know what SDK to use to spawn tools from the SDK.
But when i wanted to add it, it said that it was not a valid flutter sdk.
I tried multiple times, to add the folder (including the /bin holder) and also (excluding the /bin folder).
I tried using the global FVM version aswell as a local FVM version. Both failed.
My PATH was correctly setup to point to the FVM path, so when i types: flutter --version i was pointing to the FVM global flutter version.
@stan-at-work which platform are you on? Your first screenshot had paths like /Users (I think was macOS) but the last screenshot is PowerShell. Is the same thing happening the same on both?
Can you confirm that the fvm\default folder was the exact folder selected in the "Locate SDK" prompt?
@stan-at-work which platform are you on? Your first screenshot had paths like /Users (I think was macOS) but the last screenshot is PowerShell. Is the same thing happening the same on both?
Can you confirm that the fvm\default folder was the exact folder selected in the "Locate SDK" prompt?
I was first on and then on Windows, but both devices have the same behavior i can confirm.
I was able to reproduce an issue, but it was slightly different - it just re-prompted me and did not say it was invalid. However if I restarted VS Code it worked fine. I think that is a race between saving the configuration and reloading (or, we don't reload correctly). I will fix this, but I'm not certain if it's the same issue you're seeing.
Btw, what is the fvm/default folder in your screenshot? I downloaded stable and I have C:\Users\User\fvm\versions\stable which I was testing with, but I don't see how I'd have a folder named "default", so it's possible I'm not testing exactly the same.
The bug I'm seeing was introduced in #5989. I moved some code that reloaded config when it changed from the config class (which always ran early on) to somewhere that only runs after startup (which means it does not fire during the prompt for SDK).
My suspicion is that it's the same issue you're seeing, but if you can confirm exactly the error you see after selecting the SDK to confirm, that will help.
Note: You may need to remove the dart.flutterSdkPath setting from your User Settings to re-trigger the issue, since that's where it is recorded when you select it.
de00c7b solves the issue I am seeing, and I'm fairly sure yours too, but I'll wait for confirmation of the exact message before closing.
As you said and recreated the 'locate your sdk' infobar was re-prompted a couple of times, i do not recall a specific error message. (I think i wrote that but actualy what i ment was it re-prompting again and again)
The 'default' folder is created when you set a global fvm version. Thro 'fvm -g install 3.35.6'
Sorry for not responding - it does sound like the same issue so I'll close this with the fix above. The fix is already available in the pre-release version of the extension if you want to try it out before the next release.
Activity
stan-at-work commentedon May 30, 2026
I have installed a global version of flutter now using FVM global (not the solution what I want) but this show's that it works when there is any flutter installed.
So this needs to be changed if possible.
DanTup commentedon Jun 1, 2026
@stan-at-work I checked the code, and this command should always be available as long as we have found a Flutter project in the workspace.
However, startup would stall if we cannot find a Flutter SDK at all. In this case, there should be a notification in the bottom right corner saying we can't find an SDK and asking you to locate one - is that what happens in this case?
If so, you'll need to provide some way for Dart-Code to know what SDK to use to spawn tools from the SDK.
I'm not very familiar with FVM, but it does have some info about using with VS Code here: https://fvm.app/documentation/guides/vscode
stan-at-work commentedon Jun 1, 2026
Yes, i got the notification in the bottom right.
But when i wanted to add it, it said that it was not a valid flutter sdk.
I tried multiple times, to add the folder (including the /bin holder) and also (excluding the /bin folder).
I tried using the global FVM version aswell as a local FVM version. Both failed.
My PATH was correctly setup to point to the FVM path, so when i types:
flutter --versioni was pointing to the FVM global flutter version.DanTup commentedon Jun 1, 2026
Can you try running the following in the exact folder that you selected (the root of the SDK, which contains the
binfolder):And provide the full output (minus any redactions to parts of paths you need to make).
stan-at-work commentedon Jun 1, 2026
DanTup commentedon Jun 1, 2026
@stan-at-work which platform are you on? Your first screenshot had paths like
/Users(I think was macOS) but the last screenshot is PowerShell. Is the same thing happening the same on both?Can you confirm that the
fvm\defaultfolder was the exact folder selected in the "Locate SDK" prompt?stan-at-work commentedon Jun 2, 2026
I was first on and then on Windows, but both devices have the same behavior i can confirm.
DanTup commentedon Jun 2, 2026
Is this the behaviour you see on both platforms?
I was able to reproduce an issue, but it was slightly different - it just re-prompted me and did not say it was invalid. However if I restarted VS Code it worked fine. I think that is a race between saving the configuration and reloading (or, we don't reload correctly). I will fix this, but I'm not certain if it's the same issue you're seeing.
DanTup commentedon Jun 2, 2026
Btw, what is the
fvm/defaultfolder in your screenshot? I downloaded stable and I haveC:\Users\User\fvm\versions\stablewhich I was testing with, but I don't see how I'd have a folder named "default", so it's possible I'm not testing exactly the same.DanTup commentedon Jun 2, 2026
The bug I'm seeing was introduced in #5989. I moved some code that reloaded config when it changed from the config class (which always ran early on) to somewhere that only runs after startup (which means it does not fire during the prompt for SDK).
My suspicion is that it's the same issue you're seeing, but if you can confirm exactly the error you see after selecting the SDK to confirm, that will help.
Note: You may need to remove the
dart.flutterSdkPathsetting from your User Settings to re-trigger the issue, since that's where it is recorded when you select it.Fix handling of "Locate SDK"
DanTup commentedon Jun 2, 2026
de00c7b solves the issue I am seeing, and I'm fairly sure yours too, but I'll wait for confirmation of the exact message before closing.
stan-at-work commentedon Jun 2, 2026
As you said and recreated the 'locate your sdk' infobar was re-prompted a couple of times, i do not recall a specific error message. (I think i wrote that but actualy what i ment was it re-prompting again and again)
The 'default' folder is created when you set a global fvm version. Thro 'fvm -g install 3.35.6'
DanTup commentedon Jun 15, 2026
Sorry for not responding - it does sound like the same issue so I'll close this with the fix above. The fix is already available in the pre-release version of the extension if you want to try it out before the next release.
Thanks!