How to give Flutter SDK Path in Android Studio on Mac os

33,431

Solution 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 :-

  1. Install Android studio

  2. 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

  1. Download the Flutter SDK

  2. Extract it where do you want (for example - /Users/vrushali/Downloads/flutter)

  3. 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

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

asdf

If you have used asdf to install Flutter SDK.

You can find the location of the flutter by using the following commands,

  1. Open the location of asdf in terminal

    open ~/.asdf
    
  2. Inside the .asdf folder go to installs folder and then to flutter folder. Inside the flutter 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

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.
Share:
33,431
Vrushali Raut
Author by

Vrushali Raut

A strong passion for learning and adapting to new technologies,In this 2.5 year's I have gained a combination of soft-skills and domain knowledge. A real passion for Android application development. • Programming Languages i worked :- Android,Java,Kotlin. Newly started learning Python :) Stackoverflow is the most helpfule site for new learner,fresher. and yes ofcourse first search:) I started solving android challenges by referring stackoverflow question,answer's And Now it's my time to help people who are stuck. I would love to solve the problems and learn by sharing knowledge :)

Updated on July 09, 2022

Comments

  • Vrushali Raut
    Vrushali Raut almost 2 years

    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.

  • Vrushali Raut
    Vrushali Raut over 5 years
    Yes because since yesterday was solving.. :)
  • onelaview
    onelaview over 3 years
    Alternatively, you can run asdf which flutter command in your terminal to get the path to currently active Flutter SDK in your local machine.
  • ENG618
    ENG618 about 3 years
    asdf which flutter will actually take you to the flutter executable, asdf where flutter will take you to the actual location of the configured version of flutter sdk you are using with asdf. So I ended up adding the following to my zsh environment variables export FLUTTER_ROOT=$(asdf where flutter)
  • AMS Abu
    AMS Abu over 2 years
    Thanks, I found this really helpful. In order to get it work, I had to navigate to my development directory and entered echo $PATH. I then copied the full path and replaced everything after the colon and before the closing quotation; PATH="$PATH:[here]". Thereafter, I pressed the esc key and typed : followed by wq!. That's what worked for me. THANKS.