It will check that all prerequisites are satisfied, Flutter is properly installed and configured, and your Android or iOS development environment is bug-free.The error message “Flutter command not found” appears whenever the terminal is unable to carry out a Flutter Command Not Found. Usually, this occurs when either Flutter is not installed, the installation is incomplete, or the PATH environment variable is not set.
These are some broad measures you can take to attempt to resolve the “Flutter command not found” error:
Check if Flutter is installed:
- Terminal: flutter —version. Flutter is installed if it returns a version. Install Flutter.
Add Flutter to your PATH:
- The command may not be added to the PATH environment variable if Flutter has been installed but is not yet recognized.
- Add the following line to your
.bashrc
or.zshrc
file (depending on your shell):export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin"
- Replace
[PATH_TO_FLUTTER_GIT_DIRECTORY]
with the path to your Flutter installation directory.
Restart your terminal:
- After adding Flutter to your PATH, restart your terminal or run
source ~/.bashrc
(orsource ~/.zshrc
) to apply the changes.
- After adding Flutter to your PATH, restart your terminal or run
Verify your installation:
- Run the command
flutter doctor
to verify your installation and check for any issues.
- Run the command
If none of these steps work, you may need to reinstall Flutter or seek further assistance.
To check if Flutter is installed on your system ans still show “Flutter command not found”, you can follow these steps:
- Open a terminal or command prompt on your system.
- Type the command
flutter --version
and press Enter. - If Flutter is installed, you should see the version number of your Flutter installation printed in the terminal. For example:
Flutter 3.7.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision c07f788888 (3 weeks ago) • 2023-02-22 17:52:33 -0600 Engine • revision 0f359063c4 Tools • Dart 2.19.2 • DevTools 2.20.1
If you see a message indicating that the Flutter Command Not Found, then Flutter is not installed on your system.
To add Flutter to your PATH environment variable, you can follow these steps:
- Find the directory where Flutter was installed. If you have Flutter installed in your home directory on Linux, the full path could be /home/your username/flutter.
- With the command
cd
, which stands for “change directory to,” you may get to your home directory once you open a terminal or command prompt. - Launch the shell’s profile editor. The Bash shell’s.bashrc file can be opened with the Nano text editor by typing the command
nano.bashrc
, for instance. - Add the following line at the end of your shell profile file, replacing
/path/to/flutter
with the actual path to your Flutter installation directory:
export PATH="$PATH:/path/to/flutter/bin"
- Exit the text editor and save your shell profile modifications.
- Reload your shell profile by running the command
source ~/.bashrc
(orsource ~/.zshrc
if you are using the Zsh shell). - Verify that Flutter is in your PATH by running the command
echo $PATH
. You should see the path to your Flutter installation directory listed in the output.
To verify your Flutter installation, you can use the flutter doctor
command. Here are the steps to run flutter doctor
:
- Open a terminal or command prompt on your system.
- Type the command
flutter doctor
and press Enter. - If you run the
flutter doctor
command, Flutter will do an inspection and report any problems it discovers. For instance, it will verify that all prerequisites have been met, that Flutter is properly installed and configured, and that your Android or iOS development environment is free of any known bugs. - If any issues are found,
flutter doctor
will provide guidance on how to fix them. Follow the instructions provided byflutter doctor
to resolve any issues. - Once all issues are resolved,
flutter doctor
will display a message indicating that your Flutter installation is healthy and ready for development.
Verifying your Flutter installation with flutter doctor
is an important step to ensure that your development environment is set up correctly and that you can start building Flutter apps without any issues. read too Button with Border Radius in Flutter