VS Code says it cannot find the Flutter SDK
VS Code can't find the PATH to the Flutter SDKShort 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.
Fix it fast
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 --version2Match what you see, then jump to its fix
- 1
which flutter prints nothingFlutter's bin folder is not on PATHFix - 2
The terminal finds flutter but VS Code still does notVS Code was not restarted, or the setting points at nothingFix - 3
No Flutter version or devices in the status bar although the SDK worksThe folder is not opened as a Flutter projectFix
- 1
What does the error look like?
VS Code can't find the PATH to the Flutter SDKNo 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 $PATH2Fix
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 --versionConfirmed by docs.flutter.dev
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.flutterSdkPath2Fix
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 DoctorConfirmed by dartcode.org
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.yaml2Fix
Open the folder that directly contains pubspec.yaml with File > Open Folder.
code path/to/project3Verify
The status bar shows the Flutter version and a device picker.
# Command Palette > Flutter: Select DeviceConfirmed by docs.flutter.dev
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- Qist BazaarA buy-now-pay-later marketplace built from a blank repo, now past 100K downloads on Google Play.
- SessionBirdAn omnichannel engagement suite in Flutter: campaigns, chatbot, tickets, analytics and live calling.
Related fixes
Mobile apps
Terminal says pub: command not found after installing Dart
dart: command not found
The standalone pub program no longer exists in current Dart.
2 causes, each with a fixMobile apps
The terminal cannot find the flutter or dart command
zsh: command not found: flutter
The flutter and dart programs both live in the bin folder of the Flutter SDK, so one PATH entry gives you both.
3 causes, each with a fixMobile apps
flutter doctor warns that dart on your path is not in the Flutter SDK
Consider adding C:\flutter\bin to the front of your path.
flutter doctor found a dart program on your PATH that lives outside the Flutter SDK folder, usually a separate Dart SDK installed earlier in the list.
3 causes, each with a fixMobile apps
flutter doctor fails the Network resources check
A cryptographic error occurred while checking
The Network resources check sends a request to a fixed list of hosts and fails if one does not answer.
2 causes, each with a fixMobile apps
A Flutter command says it cannot find pubspec.yaml
This command should be run from the root of your Flutter project.
Flutter and Dart read pubspec.yaml from the current working directory.
3 causes, each with a fixMobile apps
Flutter keeps retrying 'pub upgrade' for its own tool
Got socket error trying to find package
The flutter command rebuilds its own tool and downloads packages from pub.dev to do it.
3 causes, each with a fix