Skip to content

🐛 dart.changeFlutterSdk not available without global Flutter SDK #6065

Closed

Description

@stan-at-work

🐛 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.

Activity

  1. stan-at-work commented on May 30, 2026

    @stan-at-work
    Author

    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.

    Image

    So this needs to be changed if possible.

  2. DanTup commented on Jun 1, 2026

    @DanTup
    Member

    @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

  3. added
    awaiting infoRequires more information from the customer to progress
    on Jun 1, 2026
  4. stan-at-work commented on Jun 1, 2026

    @stan-at-work
    Author

    @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

    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 --version i was pointing to the FVM global flutter version.

  5. DanTup commented on Jun 1, 2026

    @DanTup
    Member

    But when i wanted to add it, it said that it was not a valid flutter sdk.

    Can you try running the following in the exact folder that you selected (the root of the SDK, which contains the bin folder):

    ls "bin/flutter" "bin/flutter.bat" "analysis_options.yaml" "bin/internal/engine.version"
    

    And provide the full output (minus any redactions to parts of paths you need to make).

  6. stan-at-work commented on Jun 1, 2026

    @stan-at-work
    Author

    But when i wanted to add it, it said that it was not a valid flutter sdk.

    Can you try running the following in the exact folder that you selected (the root of the SDK, which contains the bin folder):

    ls "bin/flutter" "bin/flutter.bat" "analysis_options.yaml" "bin/internal/engine.version"
    

    And provide the full output (minus any redactions to parts of paths you need to make).

    Image
  7. DanTup commented on Jun 1, 2026

    @DanTup
    Member

    @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?

  8. stan-at-work commented on Jun 2, 2026

    @stan-at-work
    Author

    @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.

  9. DanTup commented on Jun 2, 2026

    @DanTup
    Member

    it said that it was not a valid flutter sdk.

    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.

  10. DanTup commented on Jun 2, 2026

    @DanTup
    Member

    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.

  11. DanTup commented on Jun 2, 2026

    @DanTup
    Member

    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.

  12. added a commit that references this issue on Jun 2, 2026
  13. removed
    awaiting infoRequires more information from the customer to progress
    on Jun 2, 2026
  14. added this to the v3.138.0 milestone on Jun 2, 2026
  15. DanTup commented on Jun 2, 2026

    @DanTup
    Member

    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.

  16. stan-at-work commented on Jun 2, 2026

    @stan-at-work
    Author

    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'

  17. DanTup commented on Jun 15, 2026

    @DanTup
    Member

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions