[android-studio] Flutter command not found

bash: flutter: command not found

Apparently, none of the flutter commands are working on the terminal of an android studio which I believe I am trying to run it at the root of my project.

This question is related to android-studio flutter dart command-line terminal

The answer is

this works for me.

i was giving my whole path like this:

export PATH=Users/Tekion/Downloads/flutter/bin:$PATH

It started working after i changed my whole path to

export PATH=$HOME/Downloads/flutter/bin:$PATH

The best way to setup Flutter on Mac

    1. Open a new terminal window
    2. Type: git clone https://github.com/flutter/flutter.git -b stable
       Wait for the SDK to clone onto your machine
    3. Type: export PATH="$PATH:`pwd`/flutter/bin", which adds flutter tool to your path
    4. Type: flutter doctor , which downloads additional dependencies

    Wait for dependencies to download and install

flutter installation issue in Mac OS (Specific for Big Sur).

  1. Cheak which shell is your default shell, That you have in the terminal.
  2. To check default shell type command echo $SHELL.
  3. for my specific issue I have the zsh as my default shell.
  4. So I change my zsh as my default shell to bash.
  5. To change the default shell enter the believe command.
  6. chsh -s /bin/bash
  7. Enter your password when you promoted
  8. Now I have bash shell as my default.
  9. Then I just follow the standard process for flutter setup in flutter’s official site.
  10. And I have successfully configured the flutter in my Mac OS.

Extract the file in the desired location, for example:

—> $ cd ~/development —> $ unzip ~/Downloads/flutter_macos_1.22.5-stable.zip

Add the flutter tool to your path:

export PATH="$PATH:`pwd`/flutter/bin"

This command sets your PATH variable for the current terminal window only. To permanently add Flutter to your path see below.

—> Determine the directory where you placed the Flutter SDK. —> Open (or create) the rc file for your shell. Typing echo $SHELL in your Terminal tells you which shell you’re using. If you’re using Bash, edit $HOME/.bash_profile or $HOME/.bashrc. If you’re using Z shell, edit $HOME/.zshrc. If you’re using a different shell, the file path and filename will be different on your machine.

—> Add the following line and change [PATH_TO_FLUTTER_GIT_DIRECTORY] to be the path where you cloned Flutter’s git repo


—> Run source $HOME/.<rc file> to refresh the current window, or open a new terminal window to automatically source the file.

—> Verify that the flutter/bin directory is now in your PATH by running:

echo $PATH

—> Verify that the flutter command is available by running

—> which flutter

—> now run below command.

 $ which flutter dart

—> And your good to go.  

For MacOs Catalina users with ZSH Shell.

The following procedure fixes the "command not found: flutter".

  1. Open your terminal, go to your home directory and type the following command:

    export PATH ="/YourHomeDirectory/YourUsername/YourDirectory/flutter/bin:$PATH"

  2. Check the version of Flutter you have, write the following command:

    flutter --version

  3. Dart and some tools will be downloaded. After a few minutes, you will be ready to work.

  4. If you use zsh shell instead of Bash shell, you must edit the .zshrc file (it is located in your home directory) and write the following command at the end:

    export PATH="/YourHomeDirectory/YourUsername/YourDirectory/flutter/bin:$ PATH"

This will make the change permanent, if you don't edit the .zshrc file the change will be lost when closing the terminal window.

  1. Save the changes, exit the file and reload the terminal.

For Linux: To remember flutter commands permanently:

1.) open up terminal and cd to $HOME. for eg: username@linux:~$

2.) open the hidden file .bashrc with your desired editor. It resides in $HOME.eg. sudo gedit .bashrc

3.) add the following line export PATH=/home/username/flutter/bin:$PATH somewhere as a newline in .bashrc file preferably as the last line edit & save the file.

4.) run source /home/yourname/.bashrc in terminal to process your recent changes.

5.) finally, run echo $PATH to see flutter dir is in your system path along with other such paths. for eg: /home/username/flutter/bin


Mac OS Mojave; Wireshark Path problem

As I can't comment, I'm answering:

In your terminal, run:

touch $HOME/.bash_profile

vi $HOME/.bash_profile

Now use I to insert and paste the following:


Use esc and type :wq! to save the file and exit.


source $HOME/.bash_profile

And verify it's OK by running:

echo $PATH

Ubuntu 16.04 :-

I added the path correctly for Flutter, Java, Android Studio and Android SDK in .bashrc file , but when I run flutter doctor, the terminal returns

flutter: command not found

Solution :-

So,first I had to always run ->

sudo su

then ->

source /home/your_name/.bashrc

Then run flutter doctor, it works fine.

So everytime, If I want to run flutter doctor, I have to run these above 2 commands.

Hope it helps :)

You need to edit you Zsh or bash profile. macOS Catalina uses the Z shell by default, so edit $HOME/.zshrc.

If you are using a different shell, the file path and filename will be different on your machine.

PATH_TO_FLUTTER_GIT_DIRECTORY == Location to your flutter SDK file.

To edit $HOME/.zshrc:

  1. open Terminal

  2. copy and paste nano $HOME/.zshrc

  3. copy next line and paste it at bottom

    export PATH="[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH"


It will look something like this--> for example:

export PATH="/Users/flutter/bin:$PATH"

press CTRL X and when it asked you to save the file, choose yes.
Close and Restart the Terminal and try running flutter doctor

Verify that the flutter/bin directory is now in your PATH by running:

echo $PATH

[PATH_TO_FLUTTER_GIT_DIRECTORY] is where you installed flutter SDK.

Instead of nano, you can use any text editor to edit ~/.bash_profile or .zshrc

Tried out all the above methods, but all of them lasted only until the terminal was open. So I went ahead and directly added it to the path file permanently.

sudo nano /etc/paths

add this to the file


Save the file by pressing CTRL + X, Y and then Enter. Close the terminal and reopen it again. Tada!

after follow installation guide, download and extract, just try this command, you can change file depending on where you extract SDK, in my case it was home and works fine..

export PATH="$PATH":"$HOME/flutter/bin"

then try:

flutter --version

if works don't forget to complete remain installation steps.

Add Path in this way in .bashrc for Linux and for Mac .bash_profile of android sdk and tools with flutter

export PATH=$PATH:/user/Android/Sdk/platform-tools:/user/Android/Sdk/build-tools/27.0.1:/user/Android/Sdk/tools:/user/Android/Sdk/tools/bin:/user/Documents/fluterdev/flutter/bin:$PATH

Then run this command

On Linux

source ~/.profile

On Mac

source ~/.bash_profile or open -a TextEdit ~/.bash_profile

enter image description here

Then you can user any of flutter command like to build fluter apk

flutter build apk

In macOS Catalina the default shell is Zsh. I did Following command on Terminal:

  1. nano .zsh (Will open command line editor)
  2. export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH"
  3. Save file by "Control" + "O" then Press "return"
  4. "Control" + "X" to exit
  5. Relaunch Terminal.
  6. echo $PATH

The answer given by this is correct to me : https://github.com/flutter/flutter/issues/15408#issuecomment-373424994

After cloning the repo, don't cd ./flutter before running the commad. the pwd represent the current directory where you were before cloning the repo. The full command is:

export PATH=`pwd`/flutter/bin:$PATH

You can make life easier by adding it to your bashrc or zshrc

Move flutter to home dir

$ mv flutter ~

Add the path to your ~/.zshrc
export PATH
Source it source ~/.zshrc

Flutter SDK can be run on windows as well ass macOs

For Windows

  1. First download the lates SDK from flutter download page.
  2. Now to run flutter in windows console you need to update your PATH environment variable.
  3. From the Start search bar, type ‘env’ and select Edit environment variables for your account.
  4. Under User variables check if there is an entry called Path:

    1.If the entry does exist, append the full path to flutter\bin using ; as a separator from existing values.
    2.If the entry does not exist, create a new user variable named Path with the full path to flutter\bin as its value.

For Mac

  1. First download the lates SDK from flutter download page

  2. Extract the file in the desired location using following commands :

    1. cd ~/development
    2.unzip ~/Downloads/flutter_macos_v1.5.4-hotfix.2-stable.zip
  3. Add the flutter tool to your path:

    1.export PATH="$PATH:`pwd`/flutter/bin"

Run flutter doctor

Do this to add flutter permanently to your path (in Ubuntu):

  1. cd $HOME
  2. gedit .bashrc
  3. Append the line:
export PATH="$PATH:[location_where_you_extracted_flutter]/flutter/bin"

in the text file and save it.

  1. source $HOME/.bashrc
  2. Open new terminal and and run flutter doctor command

You can do these..

  1. First, open your Mac Terminal
  2. Run 'open -e .bash_profile'
  3. Then add 'PATH="/Volumes/Application/Mobile/flutter/bin:${PATH}" export PATH'
  4. Then Save file & close

If your are facing this issue from a Windows 10, that's how i solved this

first of all, find your flutter path, and than your bin folder under de flutter path

e.g. "C:\flutter\bin"

copy it, then pres the windows button, type: environment, and press "Edit the system environment variable"

press "environment variable" button

double click on "Path" menu

Add a new path, using the bin address

e.g ""C:\flutter\bin"

this should work

You can easily create a symbolic link as below,

sudo ln -s /opt/flutter/bin/flutter /usr/bin/flutter

I had moved flutter into /opt/ folder after downloading, so replace with the path you have flutter directory.

flutter command should work even after rebooting your machine.

For Ubuntu 14.*

there is no .bash_profile file but it just a .profile in /home/mangesh

In my case,I am running this command to add flutter/bin path,

export PATH="$PATH:/home/mangesh/Documents/flutter_data/flutter/bin/"

To verify above change just run,

echo $PATH

Following is my complete output,

mangesh@Mangesh:~$ pwd

mangesh@Mangesh:~$ export PATH="$PATH:/home/mangesh/Documents/flutter_data/flutter/bin/"

mangesh@Mangesh:~$ echo $PATH


You need to set the path correctly.and also if you are facing problem like it is now working when the terminal is reopened then you should try this method and simply restart your computer after doing.

open your terminal and type

nano ~/.profile

and add this line end of the file and change Add the following line and change [PATH_TO_FLUTTER_GIT_DIRECTORY] to be the path where you cloned Flutter’s repository.


For example i am showing you what i have done in my case. enter image description here

Now simply ctrl + O and hit enter

then type in your terminal

source ~/.profile

and to check your path just run

echo $PATH

now just simply type flutter in your terminal. hope it will work.

For zsh users:

  1. Open terminal run

    touch $HOME/.zshrc

  2. Run

    sudo nano ~/.zshrc

  3. Type

    export PATH=$PATH:/Path to your extracted flutter/Flutter/bin

  4. Press ctrl+x then press y

  5. Press Enter

  6. Close the terminal and open a new terminal and run

    flutter doctor

On MacOS Catalina, open terminal, follow this step:

  1. Create zshrc file: touch ~/.zshrc
  2. Open file zshrc: open ~/.zshrc
  3. Insert this line to file, type: export PATH="/Users/YOUR_NAME/Downloads/flutter/bin:$PATH" Save file and close. (explain: YOUR_NAME -is name of user your Mac, Downloads -is folder i put folder flutter)

After setting up and properly configuring my PATH variables i still got the error message

command not found: flutter

It's very important that you don't forget to restart your terminal for the changes to take effect.

Simply run source $HOME/.bash_profile to refresh/restart the terminal.

If you're on a macOS using the Z shell you should add the path to your flutter bin directory to $HOME/.zshrc

if u meet this error in macOS, and install zsh, I am solved in this way

  1. in .zshrc file
  2. export path dont use ~/xxx/bin, use /xxx/xxx/xxxx/bin
  3. source .zshrc

On macOS Catalina ,The issue is with Path

  1. Open Terminal & check the shell [command : echo $SHELL ],

If output is /bin/bash

We need to convert to Zsh. Zsh is only the default shell on newly created user accounts, so any existing accounts you have on an upgraded Mac will still use Bash by default unless you change it. simply run the chsh -s (change shell) command in a Terminal window.

[command : chsh -s /bin/zsh ]

Enter your password when prompted. After you close the terminal window and reopen it, you’ll be using Zsh.

  1. Update your Path

2.1. Open the zshrc file [command : vim ~/.zshrc ]

2.2. Press 'I' to insert the path as [ export PATH=~/Dev/flutter/bin:$PATH ] ,here ~/Dev/ is the Folder where Flutter is installed

2.3. Hit ESC Key and then :wq to save and exit the file

  1. Done ! try [command : flutter doctor ]

I faced this problem and I resolved it following these steps:

  1. : nano ~/.bash_profileexport

  2. : add this line: PATH=/Users/user/Documents/flutter_sdk/flutter/bin:$PATH make sure the dir to your flutter bin is correct.

  3. :source ~/.profile

How to Install Flutter on MacOS To permanently add Flutter to your path, follow this command line

  1. Open (or create) the rc file for your shell. Typing echo $SHELL in your Terminal tells you which shell you’re using. If you’re using Bash, edit $HOME/.bash_profile or $HOME/.bashrc. If you’re using Z shell, edit $HOME/.zshrc. If you’re using a different shell, the file path and filename will be different on your machine.

    In your terminal, run:

    touch $HOME/.bash_profile
    vi $HOME/.bash_profile

In Catalina your default shell is ZSH, thus you can also replace the '(dot)bash_profile' to '(dot)zshrc' [without quote and replace the dot] and the rest is the same!

Also to check for environment is running, you can just type 'flutt' + TAB, and if autocomplete kicks in you are done!

  1. Add the following line and change [Flutter SDK] to be the path where you extracted Flutter SDK and save

    If this is not working:

    export PATH="$PATH: /Users/Desktop/flutter/bin"

    Try this instead:

    export PATH="$HOME/Users/Desktop/flutter/bin:$PATH"

Save the file and close it.

  1. Run source $HOME/.bash_profile to refresh the current window, or open a new terminal window to automatically source the file.

  2. And verify that the flutter/bin directory is now in your PATH by running:

    echo $PATH

For see more : https://www.youtube.com/watch?v=ZwUGHiroGBo

In Mac, There are two options to solve this issue.

Option 1: Adding the flutter SDK path permanently(it will work in any terminal session)

Download the flutter SDK and extract in any location and then you have to add the below line in $HOME/.bash_profile file(hidden folder as default).

export PATH="$PATH:[where flutter sdk downloaded and extracted]/flutter/bin"

for eg:export PATH="$PATH:~/development/tools/flutter/bin"

Option 2: If you are facing any difficulties with Option 1, then this is much simpler but you have to do this simple step whenever you restart your system/terminal.

Step 1: Go to the path where flutter SDK downloaded and extracted (eg: cd ~/Development/tools/)

Step 2: Enter this command

export PATH='pwd'/flutter/bin:$PATH

That's it. Type "flutter doctor" to check this issue gets resolved. Happy Coding.

First, download the Flutter here: https://flutter.dev/docs/get-started/install/macos

When you created the folder with Flutter SDK, open it in Terminal using the following command:

cd ~/development

If there is no development folder run this command first:

mkdir /development

After that, you need to run the unzip command. Make sure you specify the correct path to the downloaded Flutter archive file. Run the command below:

unzip ~/Downloads/flutter_macos_1.17.1-stable.zip

Setting the Flutter tool path

In order to set up the Flutter tool path you should run this command:

export PATH="$PATH:`pwd`/flutter/bin"

Next, you need to know which shell you are using. For this run this command:

echo $SHELL

Depending on the shell run the following command: [Note, the command you will be using depends on the shell you have.]

sudo nano ~/.zshrc


sudo nano /.bashrc 

After that in the new window, you need to add a path to the flutter tool.

Use the following command:

export PATH=$PATH:~/development/flutter/bin

The next thing you need to do is to check the Flutter dependencies.

For this, run the command:

flutter doctor

This operation will help you to identify if there are any dependencies you need to install. After the results will be prepared click Agree and wait for the installation of the needed dependencies to complete the setup. enter image description here

flutter document tell us

cd ~/development
unzip ~/Downloads/flutter_macos_1.17.5-stable.zip

directory like this


Then he told us to do this

export PATH="$PATH:`pwd`/flutter/bin"

Then the problem is coming, the file path name does not correspond


you need change file name like this


or change export path

export PATH="$PATH:`pwd`/flutter_macos_1.17.5-stable/bin"

If you are on MAC OS

First find the location of your flutter sdk

Flutter SDK File: Write the below command on your terminal to download the flutter sdk

git clone https://github.com/flutter/flutter.git

For example: the SDK file name is flutter and it is in Downloads

Close and open your terminal again

and enter the following commands in your terminal

cd Downloads     #go to Downloads

cd flutter   #go to flutter

pwd       #/Users/[USERNAME]/downloads/flutter/

whoami      #Your [USERNAME]

export PATH="/Users/[USERNAME]/downloads/flutter/bin":$PATH

I hope you will manage on based on the example I have given. Upvote the answer if you find it useful.

On the mac I followed the steps of the user Tree but still received the answer "flutter: command not found". What I did next was, go to the folder flutter/bin and inside this folder ctrl+click on flutter executable and in the popup i clicked open. After that the mac already recognized this as an exception and the flutter commands already work.

run the command like this on Windows

C:\flutter\bin> .\flutter doctor

The flutter installation guide says you add this:

export PATH="$PATH:pwd/flutter/bin"

VSC doesn't support pwd for some reason. The fix:

export PATH="$PATH:~/flutter/bin"

My solution was to open the bash file in the terminal.

  1. Go to Terminal
  2. go to the top level dir
  3. type: open bash
  4. Another Terminal will open
  5. Now type "flutter" in the new terminal and it will function.

If you are using zsh, you need to follow the steps below in mac.

  • Download latest flutter from the official site.
  • Unzip it and move to the $HOME location of your mac.
  • Add to path via .zshrc file.
  • Run nano ~/.zshrc into iTerm2 terminal.
  • Export PATH=$HOME/flutter/bin:$PATH
  • Save and close the ~/.zshrc file.
  • Restart iTerm2.
  • Now you will have flutter available.

Just revert to chsh -s /bin/bash from chsh -s /bin/zsh,

Run one command

chsh -s /bin/bash

Your facing this problem just because of you have change shell from /bash to /zsh in macOs. If you run this command again it will change the path again. So just run one command and problem solve.

After you followed the tutorial, if your mac is not even able to run "flutter doctor", you should reboot your mac. This worked for me.

I followed checked answer but when i restart the terminal, the flutter command is not recognized again. my on bash_profile path is :

export PATH=~/Users/aldo/Projects/Framework/flutter/bin:$PATH with ~

then i edit to

export PATH=/Users/aldo/Projects/Framework/flutter/bin:$PATH without ~

and re run source $HOME/.bash_profile now my flutter command is recognized event i restart the terminal. hope it's help another

In my case, I put that line export PATH=[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH to both file .bash_profile and .bashrc (put it on the last line). After that, run source .bash_profile and source .bashrc. Now it's working!, even if you close the terminal.

Open your .bash_profile file located under Finder>Go>Home. Add below lines at the end of

export PATH=$PATH:/Users/Projects/Flutter/sdk/bin

Don't forget to replace /Users/Projects/Flutter/sdk/bin with your flutter path.

if exact location unknown then this command help

export PATH=~/flutter/bin:$PATH

So far, looking all the solution, none of them worked for me.

So I did it, with the help of alias in Linux

You set the alias as,

alias flutter='~/your/path/to/flutter/bin/./flutter'

Now, just type flutter doctor to see if it works.

To create alias permanently, See

Do the following steps:

  1. Download the Flutter SDK Flutter SDK Archive

  2. Extract it where do you want (for example /home/development/flutter)

  3. Set your PATH, edit your file with this command gedit ~/.profile, you need to add this line

export PATH=[location_where_you_extracted_flutter]/flutter/bin:$PATH

I showed you above where I've extracted mine, so my export will look like this

export PATH=/home/myUser/development/flutter/bin:$PATH
  1. Save the file and close it.
  2. Run source ~/.profile to load the changes
  3. If you run now flutter doctor should work!

You must have .bash_profile file and define flutter path in .bash_profile file.

  1. First of all, if you do not have or do not know .bash_profile, please look my answer: How do I edit $PATH (.bash_profile) on OSX?

  2. You should add below line(.../flutter_SDK_path/flutter/bin) in your .bash_profile

export PATH=$PATH:/home/username/Documents/flutter_SDK_path/flutter/bin

After these steps, you can write flutter codes such as, flutter doctor, flutter build ios, flutter clean or etc. in terminal of Macbook.


For those using a Z-shell resource (.zshrc), navigate to your home directory and open .zprofile, copy and paste this: export PATH=[PATH_TO_FLUTTER_DIRECTORY]/flutter/bin:$PATH

Previously i was giving my whole path like this:

export PATH=Users/Tekion/Downloads/flutter/bin:$PATH

It started working after i changed my whole path to

export PATH=$HOME/Downloads/flutter/bin:$PATH

In macOS, please edit .zshrc file instead of .bash_profile file. The content of .zshrc file is


Use the following steps for setup

  1. Download from Flutter SDK for Mac https://flutter.dev/docs/get-started/install/macos

  2. Extract the Flutter SDK zip (saved in Downloads) file using terminal. If you want to extract the Flutter SDK in fluttrerDevelopment folder

    $ cd ~/fluttrerDevelopment

    $ unzip ~/Downloads/flutter_macos_1.20.1-stable.zip

  3. Add the flutter tool to your path:

    $ export PATH=“$PATH:pwd/flutter/bin"

  4. If you have only Xcode setup in your machine then run

    $ flutter create my_first_flutter_app

    $ cd my_first_flutter_app

    $ flutter run

To those who still don't have the solution, it's because your path is wrong. Putting it in .bashrc or .profile works as long as your path is correct. Please check your flutter directory and see where the folder bin is located. mine looks like this

export PATH=$HOME/flutter/flutter/bin:$PATH

Examples related to android-studio

A failure occurred while executing com.android.build.gradle.internal.tasks "Failed to install the following Android SDK packages as some licences have not been accepted" error Android Gradle 5.0 Update:Cause: org.jetbrains.plugins.gradle.tooling.util This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()' Flutter plugin not installed error;. When running flutter doctor ADB.exe is obsolete and has serious performance problems Android design support library for API 28 (P) not working Flutter command not found How to find the path of Flutter SDK

Examples related to flutter

Flutter Countdown Timer How to make an AlertDialog in Flutter? FlutterError: Unable to load asset Set the space between Elements in Row Flutter Flutter: RenderBox was not laid out Space between Column's children in Flutter How to change status bar color in Flutter? How can I add shadow to the widget in flutter? Flutter - The method was called on null Flutter- wrapping text

Examples related to dart

How to integrate Dart into a Rails app Flutter Countdown Timer How to make an AlertDialog in Flutter? Set the space between Elements in Row Flutter Flutter: RenderBox was not laid out Space between Column's children in Flutter How to change status bar color in Flutter? How can I add shadow to the widget in flutter? Flutter - The method was called on null Flutter- wrapping text

Examples related to command-line

Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Flutter command not found Angular - ng: command not found how to run python files in windows command prompt? How to run .NET Core console app from the command line Copy Paste in Bash on Ubuntu on Windows How to find which version of TensorFlow is installed in my system? How to install JQ on Mac by command-line? Python not working in the command line of git bash Run function in script from command line (Node JS)

Examples related to terminal

Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Can't compile C program on a Mac after upgrade to Mojave Flutter command not found VSCode Change Default Terminal How to switch Python versions in Terminal? How to open the terminal in Atom? Color theme for VS Code integrated terminal How to edit a text file in my terminal How to open google chrome from terminal? Switch between python 2.7 and python 3.5 on Mac OS X