The Terminal on a Mac does not know the flutter command
zsh: command not found: flutterShort answer
zsh only runs programs found in folders listed in PATH. Flutter's launcher lives in the bin folder of the SDK, so that folder must be on PATH. Add one export line to ~/.zprofile with the absolute SDK path, then close every open Terminal and IDE session and open a new one.
Fix it fast
1Find out which cause you have
Find out whether the SDK folder exists and what the shell currently searches. If the first command lists a flutter file, the SDK is fine and only PATH is wrong.
ls ~/develop/flutter/bin/flutter echo $PATH | tr ':' '\n' | grep -i flutter2Match what you see, then jump to its fix
- 1
The echo command prints nothing, while the flutter file exists in the SDK's bin folderThe SDK bin folder was never added to PATHFix - 2
The grep above finds the export line, yet flutter is still not found in the window you already had openThe line is in the file, but the current session was started before itFix - 3
The line exists, new sessions were opened, and ls on the path from the line says No such file or directoryThe path in the export line does not match where the SDK really isFix
- 1
What does the error look like?
zsh: command not found: flutterflutter --version fails but the SDK folder exists on disk
Cause 1 of 3
The SDK bin folder was never added to PATH
1Check
Open ~/.zprofile and look for an export PATH line that mentions your Flutter folder. Flutter's own macOS instructions use this file.
grep -n flutter ~/.zprofile2Fix
Append the export line with the real absolute path of the folder where you extracted the SDK. $HOME/develop/flutter is only an example.
echo 'export PATH="$HOME/develop/flutter/bin:$PATH"' >> ~/.zprofile3Verify
In a brand new Terminal window, both tools answer.
flutter --version
dart --versionConfirmed by docs.flutter.dev
Cause 2 of 3
The line is in the file, but the current session was started before it
1Check
A shell reads its profile once at start. Terminal tabs, VS Code and Android Studio terminals opened earlier keep the old PATH.
echo $PATH | tr ':' '\n' | head -n 52Fix
Close and reopen all zsh sessions in your terminal apps and IDEs. The Flutter docs give this as the step after editing the file.
# quit Terminal and the IDE completely, then open them again3Verify
The first PATH entry is your Flutter bin folder, and the version command works.
flutter --versionConfirmed by docs.flutter.dev
Cause 3 of 3
The path in the export line does not match where the SDK really is
1Check
The docs ask for the absolute path of the folder you extracted the SDK into. A moved folder, a different name or a typo makes the entry point at nothing.
grep -n "export PATH" ~/.zprofile
ls "$HOME/develop/flutter/bin/flutter"2Fix
Edit the line so it names the folder that really contains bin/flutter, then open a new session.
export PATH="$HOME/path/to/flutter/bin:$PATH"3Verify
The version command prints the Flutter and Dart versions.
flutter --version && dart --versionConfirmed by docs.flutter.dev
How do I stop it coming back?
- Keep the SDK in one fixed folder under your home directory and do not rename it later.
- Edit the PATH line in a single profile file instead of copying it into several.
- After editing the profile, open a fresh terminal before testing.
- In VS Code, use the Flutter extension's Locate SDK prompt if the editor cannot find the SDK.
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.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
- Qist BazaarA buy-now-pay-later marketplace built from a blank repo, now past 100K downloads on Google Play.
Related fixes
Mobile apps
flutterfire configure fails in the terminal with command not found
flutterfire: command not found
FlutterFire CLI is a Dart tool installed separately.
2 causes, each with a fixMobile apps
Google Play says the app does not support 16 KB memory pages
check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a
Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.
5 causes, each with a fixMobile apps
Gradle cannot find com.google.firebase:firebase-analytics-ktx
Required by: project :app
Firebase moved the Kotlin extensions into the main modules and stopped releasing the -ktx modules in July 2025.
2 causes, each with a fixMobile apps
Gradle cannot create LibraryVariantBuilderImpl in a Flutter Android build
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl
This error appears when the Android Gradle plugin (AGP) cannot run in the Gradle or IDE you use.
3 causes, each with a fixMobile apps
Flutter release build cannot open the keystore: HmacPBESHA256 not available
Algorithm HmacPBESHA256 not available
The keystore is a PKCS12 file protected by a newer algorithm than the Java that is reading it understands.
3 causes, each with a fixMobile apps
Android install error: the package conflicts with an existing package of the same name
The package conflicts with an existing package by the same name
Android allows only one app per application ID, and an update must be signed with the same certificate as the installed version.
3 causes, each with a fix