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
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
@Happy_Coding.
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.
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.
I faced this problem and I resolved it following these steps:
: nano ~/.bash_profileexport
: add this line: PATH=/Users/user/Documents/flutter_sdk/flutter/bin:$PATH make sure the dir to your flutter bin is correct.
:source ~/.profile
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.
Flutter SDK can be run on windows as well ass macOs
For Windows
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
First download the lates SDK from flutter download page
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
Add the flutter tool to your path:
1.export PATH="$PATH:`pwd`/flutter/bin"
Run flutter doctor