'How to give Flutter SDK Path in Android Studio on Mac os, How to update Flutter SDK path in MACOS?
I have installed the Android studio and the plugin's DART,FLUTTER to kickstart the flutter but as i am not able to give path of sdk while creating my very first project for flutter.
Solution 1:[1]
I tried to find out the solution did not got solution.. Finally this are the steps i have implemented and works for me. Prerequisites :-
Install Android studio
Install plugins to kick start flutter projects (DART,FLUTTER)
You can find out this inside android studio --> preferences --> Plugins
Now you have to setup Flutter SDK path to your Android studio
Download the Flutter SDK
Extract it where do you want (for example - /Users/vrushali/Downloads/flutter)
- Open your Android studio --> start a new Flutter Project --> select default application --> next --> select flutter sdk path --> browse to the . location where you have download and extract your flutter sdk --> select the flutter --> bin --> and say okay All set..! Your project will get created in some time :)
Solution 2:[2]
Theres a better way if you want to skip
Open your Android studio --> start a new Flutter Project --> select default application --> next --> select flutter sdk path --> browse to the . location where you have download and extract your flutter sdk --> select the flutter --> bin
doing every time you open android project
Step1:
open ~/.bash_profile
Step2 paste
PATH="/Users/vrushali/Downloads/flutter/bin:${PATH}"
export PATH
This will add the path permanently
Solution 3:[3]
asdf
If you have used asdf to install Flutter SDK.
You can find the location of the flutter by using the following commands,
Open the location of asdf in terminal
open ~/.asdf
Inside the
.asdf
folder go toinstalls
folder and then toflutter
folder. Inside theflutter
folder will find the current version of the Flutter SDK as the folder name.For example, in my case the folder name is
1.12.13+hotfix.7-stable
and the path to the folder is/Users/akarshseggemu/.asdf/installs/flutter/1.12.13+hotfix.7-stable
Solution 4:[4]
For update flutter SDK path in Mac,
1. First your default shell using echo $SHELL command in Terminal.
2. Use below commane to open vim editor and update Path.
- if it is Bash then type vim $HOME/.bash_profile or vim $HOME/.bashrc
- if Z shell then type vim $HOME/.zshrc
3. Type i to enter INSERT mode (or esc to exit INSERT mode).
4. Type export PATH="$PATH:[YOUR_PATH]/flutter/bin" replacing [YOUR_PATH] with the path to the folder where you moved the flutter folder earlier ex. export PATH="$PATH:/Users/Your_User/Your_Dev_Folder/flutter/bin"
5. Type esc, then :wq! to save and exit.
6. Quit the Terminal and open it again to refresh.
7. Type echo $PATH to check that the path was correctly added.
8. Type which flutter to verify the flutter command is available.
9. Type flutter --version to check the Flutter version.
Solution 5:[5]
I asked the people that made the flutter plugin and they helped me out. For making flutter work with your IDE (haven't done this in Android but have in VScodium or Vscode).
In command line: asdf where flutter
In a text document:
export FLUTTER_ROOT="$/asdf/where/flutter/answer/should/go/here"
Add that to your bash_profile above the asdf part. Or your asdf installation won't work. With nano: ctrl+o, enter, ctrl+x.
Give your IDE the path to the installation, it should work. If not, the change needs to take effect, restart your computer.
Solution 6:[6]
This worked for me (for ZSH users)
Open terminal & run this command
touch $HOME/.zshrc
Run this command
sudo nano ~/.zshrc
Type the path like this
export PATH=$PATH:/Path to your extracted flutter/Flutter/bin
Press ctrl+x then press y Press Enter Close the terminal and open a new terminal and run this command
flutter --version
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Vrushali Raut |
Solution 2 | Ajinkya |
Solution 3 | Akarsh SEGGEMU |
Solution 4 | Bhoomika Chauhan |
Solution 5 | |
Solution 6 | Quick learner |