I have installed flutter and set up the path with the zsh file for Catalina version of mac however when I run flutter doctor or flutter precache, I receive zsh: command not found: flutter. NOTE: I managed to get through these steps previously and set up android studio however I had issues when I tried to connect the simulator for Xcode and now I have had to start again.
UPDATE: When running 'flutter' or 'flutter doctor', I receive this error: Error when reading '../../../../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No such file or directory and it says that pub upgrade failed after 10 tries.
How would I solve this?
When I run ls -a in the home directory, I see that there's a .bash_profile, a .zshrc file and a .zprofile (which I created previously) in there. Is this related to the problem?
This looks like you don't have flutter on your PATH in ZSH.
Open your .zshrc file in your terminal with
nano .zshrc
You should see the following at the top of the file
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
Add on the second line the path to the bin directory of your flutter SDK location, like mine:
export PATH=$HOME/bin:/usr/local/bin:$PATH:/Users/joaosoares/Projects/flutter/bin
Related
When I tried to run Flutter app on windows, it gives an error then says Exited Sigterm. or stmh like this.
the error says;
Re-run cmake with a different source directory
cmake files does not match...
etc.
The Steps that helped me to handle this error are;
open your terminal then write following commands
flutter clean
flutter pub get
flutter run
This will remove you build file and re-create it.
Your problem should have solved now.
I am using Mac OS. i am trying register my project in firebase and use Crashlytics in firebase to check if any crash occurs in my app I had used
curl -sL https://firebase.tools | bash
command to install flutter tools it worked fine after that I tried to run
flutterfire configure
command but it throws
zsh: command not found: flutterfire
I know that I must set $path variable but to set path variable I don't know where is my flutter tools has installed in my Mac. kindly help me to set $PATH variable
run before dart pub global activate flutterfire_cli
Once you run the following command
dart pub global activate flutterfire_cli
you should get the following output
The output is telling you the executable is not on your path variable
export PATH="$PATH":"$HOME/.pub-cache/bin"
Either run the export command in your terminal
OR
Add the command to your .zhrc file
I have installed the flutter and android studio but still getting the error
tushar#racs-MacBook-Pro ~ % flutter doctor
zsh: command not found: flutter
i was trying to update the envirnmental variable on my macbook by using the "nano ~/.zshrc" command but after adding the same I am not able to run any flutter command on terminal
please help.
First, open the terminal on your mac.
Next, use the command
cat .bash_profile
and copy the content.
Then type this command into the terminal:
nano $ HOME / .zshrc
and paste the content just copied above into. Save then type
source $ HOME / .zshrc
to refresh this file. Next type
echo $ PATH
to see if the content has been updated. If successful type
flutter --version
I am trying to install the flutter version manager to switch the flutter version among the different flutter projects.
I use the command to install the fvm - pub global activate fvm
but when I run the command on the terminal - fvm help
There is an error -bash: fvm: command not found
How to fix it ?
Your .pub-cache binaries are not yet added to your PATH variable, used by your terminal. Add path with the following command:
export PATH="$PATH:$HOME/.pub-cache/bin"
This is the location where fvm is installed. So by exporting this path to your PATH variable you should be able to get fvm working from anywhere in your terminal.
If you installed fvm using pub and you already have it in your path but you are still getting the error, follow these steps:
run dart pub cache repair // You may get an error: Failed to precompile fvm:main:. Just ignore that for now.
run dart pub global activate fvm
you can do a
flutter clean
then when its done, run
dart pub global activate fvm
when it's done it should work now, close the current bash terminal and open a new one
You must add the path to the fvm executable to the $PATH environment variable. After running "pub global activate fvm" you should have seen a warning with instructions on how to fix it. You can watch this: https://youtu.be/R6vKde1vIGQ
That will get you up and running.
if use windows 10 or later add system properties -> Environment Variables -> Path -> %USERPROFILE%\AppData\Local\Pub\Cache\bin
First confirm if fvm.bat is executing successfully, you should have the folder already in environment variable PATH(%USERPROFILE%\AppData\Local\Pub\Cache\bin). If it is then for fvm to run in bash, instead of fvm.bat, you need to create a shortcut, a file named fvm with no extension, the containing folder should also exist in PATH variable, the file contains location to fvm.bat and ends with a whitespace and S*.
I am new to flutter and having problem running flutter doctor. I have extracted the files in another folder and tried setting the path, echo $PATH gives
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
but still on running flutter doctor it says
flutter command is not found
Anybody who can help please ?
Flutter is not yet set in your PATH.
Try:
Step 1:
sudo nano .profile
Step 2:
export PATH="<Path To extracted Flutter directory>/bin:$PATH"
Step 3:
source .profile
Here is official link how to setup flutter environment
Download flutter.zip
Extract the file in the desired location, for example:
cd ~/development
unzip ~/Downloads/flutter_macos_v1.0.0-stable.zip
Add the flutter tool to your path:
export PATH=$PATH:`pwd`/flutter/bin
Try this if you are in ubuntu in terminal
sudo gedit /etc/profile
then add to the end of the file
export PATH=$PATH:`path to your extracted flutter directory`/flutter/bin
Then logout and login or restart
then
if you see flutter/bin in your path it will work. Hop it helps
try this, i hope it can help,
(in terminal)
first,
PATH=$(getconf PATH)
secondly,
export PATH="$PATH:<Flutter directory>/flutter/bin"