Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

VS Code says it cannot find the Flutter SDK

ErrorVS Code can't find the PATH to the Flutter SDK

Short answer

The Dart and Flutter extensions look for the SDK in the dart.flutterSdkPath setting, then the project, then the FLUTTER_ROOT variable and PATH. When none works, add the SDK's bin folder to PATH and restart VS Code completely, or point dart.flutterSdkPath at the SDK.

  • Applies to VS Code current, Dart and Flutter extensions, Flutter 3.x stable, macOS 26, Windows 11, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask a fresh terminal where flutter is. If the terminal cannot find it either, the problem is PATH, not VS Code.

    which flutter   # macOS, Linux
    where flutter   # Windows
    flutter --version
  2. 2Match what you see, then jump to its fix

    1. 1which flutter prints nothingFlutter's bin folder is not on PATHFix
    2. 2The terminal finds flutter but VS Code still does notVS Code was not restarted, or the setting points at nothingFix
    3. 3No Flutter version or devices in the status bar although the SDK worksThe folder is not opened as a Flutter projectFix

What does the error look like?

  • VS Code can't find the PATH to the Flutter SDK
  • No Flutter version or devices shown in the VS Code status bar

Cause 1 of 3

Flutter's bin folder is not on PATH

1Check

Run the command above in a new terminal. Remember the SDK folder you unpacked, for example $HOME/develop/flutter.

echo $PATH

2Fix

Add the SDK's bin folder to PATH as the Flutter docs describe for your shell. On macOS with zsh, append the export line to ~/.zprofile. Then close and reopen every shell and every IDE.

# macOS (zsh): add to ~/.zprofile
export PATH="$HOME/develop/flutter/bin:$PATH"

3Verify

In a new terminal the version prints.

flutter --version

Confirmed by docs.flutter.dev

Did this fix it?

Cause 2 of 3

VS Code was not restarted, or the setting points at nothing

1Check

The extension tries dart.flutterSdkPath first. If that value is blank or not a valid SDK it falls back to the project, FLUTTER_ROOT and PATH. A stale value for dart.flutterSdkPath is also a trap.

# VS Code > Settings > search: dart.flutterSdkPath

2Fix

Set dart.flutterSdkPath to the SDK folder (the one that contains bin), or clear it, then quit VS Code fully and open it again.

// settings.json
{
  "dart.flutterSdkPath": "/Users/you/develop/flutter"
}

3Verify

Run Flutter: Run Flutter Doctor from the Command Palette; the Output panel shows the detected SDK.

# Command Palette > Flutter: Run Flutter Doctor

Confirmed by dartcode.org

Did this fix it?

Cause 3 of 3

The folder is not opened as a Flutter project

1Check

VS Code only detects a Flutter project when the folder that holds pubspec.yaml is inside a workspace folder.

ls pubspec.yaml

2Fix

Open the folder that directly contains pubspec.yaml with File > Open Folder.

code path/to/project

3Verify

The status bar shows the Flutter version and a device picker.

# Command Palette > Flutter: Select Device

Confirmed by docs.flutter.dev

Did this fix it?

How do I stop it coming back?

  • Keep one Flutter install location and use the same PATH entry on all your machines.
  • Leave dart.flutterSdkPath empty unless you switch between several SDKs.
  • After changing PATH, quit and reopen VS Code, not just the window.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.