I need to uninstall Flutter completely from my Mac. However, I cannot find any documentation that can help me with that.
Flutter is an SDK that you download and unpack onto a directory in your Mac. There is no automatic uninstall process in the same way that there is no automatic install process. You "installed" it by downloading a zip file and unzipping it. All you have to do is remove the contents of the directory where you unzipped it in.
Even the path addition to be able to call the flutter command from anywhere in your system has to be done manually. If you did that, then you can remove it as well from your shell's PATH.
just rm -rf the sdk folder, or if you just want to clean a corrupt
run the following commands in the Flutter install directory:
git clean -xfd
git stash save --keep-index
git stash drop
git pull
flutter doctor
To find your flutter sdk installed path. use which flutter command and then delete the Flutter SDK folder.
Note: This command only works if you set the path correctly.
The following worked for me:
snap remove flutter
This worked for me actually:
sudo npm uninstall -g flutter-cli
Related
I try to reinstall my flutter folder, I download flutter in there website and replace the old one on the folder, but when I run flutter in terminal I get this error
fee#Mac-mini ~ % flutter
/Users/fee/Documents/flutter/bin/internal/shared.sh: line 228:
/Users/fee/Documents/flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
and I cant run even flutter doctor or flutter clean can some one help me thank you
im using mac
These links will help you -
Video
Official docs - https://flutter.dev/docs/get-started/install/macos
You have to update your path variable for flutter. At first, you need to know which shell you are using by typing echo $SHELL in your terminal. Depending on your shell, edit .bashrc, .bash_profile or .zshrc by any editor. Then you have to add below code to your shell:
export PATH="$PATH:/Users/fee/Documents/flutter/bin"
Then, type source .bashrc or source .bash_profile which you have updated earlier or logout and login back to take effect your new changes.
Check your update by typing which flutter or flutter doctor in terminal.
Try it like this.
Delete the cache folder under flutter/bin
I am trying to add flutter to the path but no solution is working for me right now. It was working before when I installed it from snap. Now I am cloning flutter repo into the opt folder and No matter what I try, flutter is not working. I am using ZSH terminal.
So far I have tried:
Adding export PATH=~/opt/flutter/bin:$PATH on last line of .zshrc and .bashrc file.
Running export PATH="$PATH:~/opt/flutter/bin" on the terminal.
And bunch of other tweaks on the keywords but none of the things seems to work.
Try this if you mean you have cloned flutter to /opt folder
export PATH="$PATH:/opt/flutter/bin"
Also if you doesn't mean that and you solely mean ~/opt folder then first verify your flutter installation by typing
~/opt/flutter/bin/flutter
in your terminal,
It should launch flutter it your terminal if not then either your installation is broken or you have to type
chmod +x -R ~/opt/flutter/bin
to make flutter executable if it's not.
PS: Also don't forget to restart your shell if you haven't cause you have to restart you shell after changing something in your .rc files.
I hope I have helped you if not please comment so that I can improve the answer.
This work on Ubuntu.
Add to file .profile the following line:
export PATH="$PATH:/home/your_user_name/opt/flutter/bin
I am working on Windows so the following command does not work.
ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1
Any idea?
The last command you mentioned is specifically for MAC users not for Windows.
Anyhow, try the below commands and check if it is working fine.
flutter channel dev
flutter upgrade
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
flutter doctor -v
Note: Make sure to change commands based on your directory structure.
I solved the issue with the following ways.
Requirement: You have Git installed on your machine.
Create a folder, for example, src directly in a root path. This procedure is the same as what explained in the flutter official download page. So you now have d:\src for example.
Open powershell or cmd, navigate to d:\src and execute git clone -b master https://github.com/flutter/flutter.git. You need to select master branch here because the stable version still has your issue (as of the time of writing).
Once the cloning finishes, execute flutter doctor -v. The problem should vanish.
You might need to set write access to the flutter folder such that Android Studio can create Flutter project files, etc.
I have been working with flutter for a week now and it runs okay, however I can't use commands such as flutter doctor or flutter upgrade on my terminal nor Android studio. Whenever I try to run a flutter command I get
zsh: permission denied: /Users/name/flutter/bin.
I tried adding the source to nano ~/.zshrc and export PATH, but nothing worked.
I faced this issue when setting up Flutter on my new mac, even after setting the PATH correctly. Turns out i installed the wrong SDK (Window). So make sure to install the correct Flutter SDK on your respective OS.
For MacOS :
https://flutter.dev/docs/development/tools/sdk/releases?tab=macos
For Window :
https://flutter.dev/docs/development/tools/sdk/releases?tab=windows
Make sure you've installed the correct SDK for your machine. For me I had installed Flutter's Windows SDK on my Mac machine.
For macOS : https://flutter.dev/docs/development/tools/sdk/releases?tab=macos
For Window: https://flutter.dev/docs/development/tools/sdk/releases?tab=windows
If you added the path and sure that you have downloaded the correct os files and still get the error:
Go to flutter folder
Empty folder
Open terminal and go to the flutter folder
git clone https://github.com/flutter/flutter.git -b stable
Run below command in the terminal, it worked for me
export PATH="/<full-path-of-flutter-folder>/bin:$PATH"
add the sudo prefix to your command. I guess you are not the admin.
eg: sudo flutter doctor
I've just tried to install Flutter on windows 10. When I try to run a flutter command (flutter doctor), I'm getting
Error: Unable to find git in your PATH.
I have set the path to both git and flutter and tried adding the following to path
C:\Program Files\Git\bin\git.exe;C:\Windows\System32
How can I resolve this???
Go to my flutter installation folder and inside flutter/bin edit the flutter.bat file using a text editor and remove the line (Line 33 in mine) that says
IF EXIST "%mingit_path%" SET PATH=%PATH%;%mingit_path%
The code should look like this on those lines
REM If available, add location of bundled mingit to PATH
SET mingit_path=%FLUTTER_ROOT%\bin\mingit\cmd
REM Test if Git is available on the Host
where /q git || ECHO Error: Unable to find git in your PATH. && EXIT /B 1
Save and Run flutter doctor and everything should work fine.
I guess its something to do with the path variables being confused.
You could try reinstalling Git with "Use Git and optional unix tools from the command prompt" selected in the installer.
This would add git and the unix tools to the path. You may have installed with only 'Use Git from Bash only' selected?
Find the flutter.bat in your flutter folder which should be inside flutter/bin and edit the flutter.bat using your text editor.
Remove the below line from the file (Mine was Line 33)
IF EXIST "%mingit_path%" SET PATH=%PATH%;%mingit_path%
The file should look like this after you remove it
REM If available, add location of bundled mingit to PATH
SET mingit_path=%FLUTTER_ROOT%\bin\mingit\cmd
Save and Run flutter doctor and everything should work fine.
I guess its something to do with the path variables being confused.
Before
After
Set the path up to bin
C:\Program Files\Git\bin
then try
git --version
if still not working, reinstall git
check these two threads for the further issues
SO
GH
It turns out I didn't have git installed
https://git-scm.com/downloads
https://git-scm.com/downloads