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 tryi
Do this to add flutter permanently to your path (in Ubuntu):
cd $HOME
gedit .bashrc
export PATH="$PATH:[location_where_you_extracted_flutter]/flutter/bin"
in the text file and save it.
source $HOME/.bashrc
flutter doctor
commandDo the following steps:
Download the Flutter SDK Flutter SDK Archive
Extract it where do you want (for example /home/development/flutter
)
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
source ~/.profile
to load the changesflutter doctor
should work!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
/home/mangesh
mangesh@Mangesh:~$ export PATH="$PATH:/home/mangesh/Documents/flutter_data/flutter/bin/"
mangesh@Mangesh:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mangesh/Documents/flutter_data/flutter/bin/
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
/Users/yourUserName/Development/flutter/bin
Save the file, Tada!
On macOS Catalina ,The issue is with Path
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.
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
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