115

When I run flutter doctor command on mac its showing below, while I already install Android Studio, and I can run ios build from Android Studio.

[!] Android Studio (not installed)

flutter doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.14.5 18F132, locale en-GB)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[!] Android Studio (not installed)
[✓] Connected device (1 available)
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
Apurva Jain
  • 1,163
  • 2
  • 6
  • 5

28 Answers28

344

In Windows


if your Android Studio install by default, you can use this command

flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"

after this command, flutter can found android studio, but the plugin can't...

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Version 10.0.18363.1016], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.48.0)
[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

In Linux (Ubuntu)


Note: for those who are facing the problem in Ubuntu and Android Studio is installed with snap:

flutter config --android-studio-dir="/snap/android-studio/current/android-studio"

Note: for those who are facing the problem in Ubuntu and Android Studio is installed with JetBrains Toolbox:

flutter config --android-studio-dir=/home/myuser/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882

Where ./201.7042822 matches the current version of Android Studio installed. You'll have to check which one you have and update it in the command above.

CivFan
  • 13,560
  • 9
  • 41
  • 58
powersee
  • 3,819
  • 2
  • 7
  • 9
  • 1
    In Mac OS - For the Android Studio folder to be discovered correctly, the .app folder must be included in the path: `flutter config --android-studio-dir="/Volumes/Esterna/Android Studio.app"` – Fed C Dec 20 '20 at 11:12
  • 6
    For Android Studio on Linux installed via JetBrains Toolbox use e.g. `flutter config --android-studio-dir="/home/jdoe/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6953283"` – Janux Jan 02 '21 at 11:28
  • 1
    Weird, why can't it find Android Studio in the default path? And how can you make it find the plugins? – Timmmm Feb 12 '21 at 17:46
  • I made an issue for this [here](https://github.com/flutter/flutter/issues/75918). – Timmmm Feb 12 '21 at 17:54
  • This helped me on ubuntu, now it sees android studio as well as java sdk. Thank you – Pitis Mar 28 '21 at 17:05
  • 1
    This worked for me on Win10 last update flutter 2.22 – Mavro Jun 19 '21 at 20:45
  • In my case, I had to remove the `=` as per the official Windows installation [instructions](https://flutter.dev/docs/get-started/install/windows#android-setup). So the command that worked was `flutter configure --android-studio-dir "C:\Program Files\Android\Android Studio"` – Stefan Sep 05 '21 at 15:14
  • The last part of this command flutter config --android-studio-dir=/home/myuser/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882 should be where 201.7042882 is the build number and not the version number. This is a tiny hint but it might save a lot of pain. – Amanda Shafack Sep 27 '21 at 18:48
  • For future readers on Linux if you have the PID of Android Studio (`ps -e | grep -i studio`) you can do: `cat /proc/[PID]/cmdline` to find the path of Android Studio as well. – Space Jul 30 '22 at 08:33
  • It works in Windows ```flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"``` – Rico Chan Oct 22 '22 at 14:53
  • For linux users, the [official installing documentation](https://developer.android.com/studio/install) recommends to install android studio under `/opt/` or `usr/local`. Depnding on where you installed it, run either `flutter config --android-studio-dir="/opt/android-studio"` or `flutter config --android-studio-dir="/usr/local/android-studio"` – jurrdb Feb 10 '23 at 15:13
44

I had a similar issue which I solved by updating my flutter config as follows:

  flutter config --android-sdk="$HOME/Android/Sdk"
  flutter config --android-studio-dir="/usr/local/android-studio"

This was on Ubuntu 20.04.1

Assumptions:

  • You have extracted the downloaded android studio zip to /usr/local/android-studio

If you install Android studio using snap then

flutter config --android-studio-dir="/snap/android-studio/current/android-studio"
Javed Ali
  • 23
  • 4
ENDEESA
  • 3,373
  • 2
  • 21
  • 17
  • This answer works on Linux Mint for me: flutter config --android-sdk="$HOME/Android/Sdk" flutter config --android-studio-dir="$HOME/AndroidStudio" – Andrea Liureta May 25 '21 at 17:56
  • Or, if you have extracted the downloaded android studio zip to **/opt/android-studio** , run: `flutter config --android-studio-dir="/opt/android-studio"` – jurrdb Feb 10 '23 at 15:15
26

I solve this issue within windows 10 pro with this exactly line:

$> flutter config --android-studio-dir= "C:\Program Files\Android\Android Studio"

notice that is an space between the equal mark and the double cotes, this solve as you can see in this print show solved right now! this is the fail attempt without the exactly formatting

hope this help new flutter developers!

ChrisF
  • 134,786
  • 31
  • 255
  • 325
Joao Victor
  • 509
  • 5
  • 10
  • 2
    Remove the extra space after "=" Try flutter config --android-studio-dir="C:\Program Files\Android\Android Studio" – sa_n__u May 30 '21 at 18:37
  • 1
    The = breaks the command for me on Win 10. The correct command for me is: flutter config --android-studio-dir "C:\Program Files\Android\Android Studio" (as seen in another answer) – LozzerJP Jun 18 '21 at 14:23
  • 9
    In my case I had to remove space to make it work `flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"` – BartusZak Jul 03 '21 at 10:10
  • 1
    Yeah In my case too I have to remove space to work it out. – Ausaf Sharif Jul 15 '21 at 15:30
24

If you have installed Android Studio via Snap, run following command

flutter config --android-studio-dir="/snap/android-studio/current/android-studio"

This will fix the issue

Community
  • 1
  • 1
Sribatsa
  • 241
  • 2
  • 4
20

flutter config --android-studio-dir C:\Program Files\Android\Android Studio will unfortunately not work because of empty space which breaks the tree structure but to solve the issue, use quotes like this: flutter config --android-studio-dir "C:\Program Files\Android\Android Studio"

Hammad Ali Shah
  • 363
  • 4
  • 12
11

A solution that worked for me was (after double clicking the downloaded file IDE) move the Android Studio program into the applications folder.

I ran Flutter Doctor and followed all prompts. worked for me.

This works on MacOS only

Maritn Ge
  • 997
  • 8
  • 35
Alrazi Bashir
  • 532
  • 1
  • 5
  • 12
  • 41
    it is mark as accepted answer but this is very unclear and vague answer, what application folder? in which os? – David B. Oct 21 '20 at 19:08
  • 4
    This is a decent answer. The question is Mac specific, and this answer is correct for Macs. – Soumendra Dec 14 '20 at 15:35
  • 1
    This worked for me. I am using MacBook and downloaded the android studio .dmg file. I am not a Mac user and double clicking the dmg file clearly did not indicate that the icon for android studio can/should be dragged to application icon. – Syed Ali Jan 15 '21 at 00:05
  • what is a application folder – chamith rasintha Jun 10 '21 at 08:39
9

I think that I had the same issue, below are steps that helped me so I would recommend to try them.
1. Android Studio is installed and you can run it, so when it boots up, select configure: Where to find configure on Android Studio screen

  1. In dropdown list open "plugins"
  2. Search for "flutter" and install this plugin together with dart.
  3. Restart the Android Studio and open a new terminal.
  4. You should be able to create a flutter project in Android Studio and "flutter doctor" should work now.

Another possible solution:
Specify path, where android studio is installed, with the following command:
flutter config --android-studio-dir=

Ikeban
  • 119
  • 4
  • 2
    Flutter and Dart are already installed. Please suggest any other option. And it's working fine for IOS. I can run IOS app on both device and simulator. IPA generated successfully. – Apurva Jain Jan 10 '20 at 13:15
  • @ApurvaJain Hmmm, if Flutter plugin is installed, do you have "Start a new Flutter project" in Android Studio starting screen? (as visible in the screen attached by me above) If yes, can you create and run flutter application? If no, would you be so kind to specify what is an error? – Ikeban Jan 11 '20 at 18:07
  • @lkeban app created but fails to run with 'Execution failed for task ':app:desugarDebugFileDependencies'. > Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Could not download arm64_v8a_debug.jar (io.flutter:arm64_v8a_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695) > Could not get resource 'http://download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/arm64_v8a_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.jar'.' – Apurva Jain Jan 13 '20 at 06:13
  • @lkeban can u plz suggest how to add error screenshot in this comment section. I am new user. – Apurva Jain Jan 13 '20 at 06:20
  • @Apurva I guess that you have to edit your first post. Note: I added update to my post above. – Ikeban Jan 13 '20 at 22:03
8

This worked for me!!

The problem is if your folder name is "Android Studio", flutter is not able to detect it later as taking only Android and skipping Studio.

Solution is :

Rename folder name from "Android Studio" To "AndroidStudio" and then run the config command :

flutter config --android-studio-dir="C:\Program Files\Android\AndroidStudio" enter image description here

Majid Sayyed
  • 191
  • 2
  • 9
6

Following worked for me.

Close opened Android studio application if any, and open the cmd as an admisitrator and give the below command

flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
Niroshan Ratnayake
  • 3,433
  • 3
  • 20
  • 18
6

This works for me in windows 8.1:

flutter config --android-studio-dir "C:\Program Files\Android\Android Studio"

2021.09.01

Viktor Jovanovski
  • 1,513
  • 10
  • 26
Szabo Gabor
  • 61
  • 1
  • 6
  • 1
    This answer is the same as (or very similar to) [this one](https://stackoverflow.com/a/63478799/8517948). It would be better to upvote that answer instead of posting it again. Invest some time in the site and you will gain sufficient [privileges](//stackoverflow.com/privileges) to upvote answers that helped you. – LW001 Sep 01 '21 at 19:55
5

For ubuntu; in the unzip directory;

flutter config --android-studio-dir="pwd/android-studio"

command work for me.

leylekseven
  • 687
  • 7
  • 15
4
  1. Go Android studio Home Screen
  2. Configure
  3. Install Flutter, Dart, Plugin
  4. Restart android studio and work properly

if now you are not able to solve the issue so please run this command and check again

C:\mycomputer>flutter config --android-studio-dir="C:\ProgramFiles\Android\Android Studio"

I Have Solve this issue with this command

enter image description here

Slava Rozhnev
  • 9,510
  • 6
  • 23
  • 39
3

You can use below command in command prompt

flutter config --android-studio-dir=""

3

The solution with : flutter config --android-studio-dir="Your_Android_Studio_Directory" worked for me.

After that you can get error messages with flutter doctor even if you have the pluggins already intalled:

[!] Android Studio X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality.

Reinstalling flutter and dart plugins in Android Studio (version 4.1) solved the problem.

  • 2
    There is a issue with Android Studio (version 4.1). This [github issue](https://github.com/flutter/flutter/issues/67986) is about this. – kaweesha Oct 15 '20 at 19:44
3

Even though this question is for mac, a lot of people like me will find this as top result. So in case you are on Windows and you installed Android Studio via JetBrains Toolchain and the paths in answers above don't work for you, this worked for me

flutter config --android-studio-dir="C:\Users\YOUR_USERNAME_HERE\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\202.7351085"

Where 202.7351085 is the folder name for my current version of Android Studio so you may need to change that too.

If you can't find Android Studio in this path, do:

  1. Search Android Studio and open file location
  2. If it's a shortcut, open location again
  3. You should be in /bin
  4. Go up one folder and that's your path
Bugzilla
  • 1,856
  • 1
  • 10
  • 16
3

Following worked for me in Windows:

flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"

flutter config --android-sdk="C:\%HOMEPATH%\AppData\Local\Android\Sdk"
Osama Abdulsattar
  • 576
  • 1
  • 4
  • 11
1

Run

flutter config --android-studio-dir=<directory-where-studio-is-installed>  

This will solve both issues of android licenses and studio not installed

1

For Linux (Ubuntu) users

  1. Run

if you installed android studio through snap (Ubuntu Software application), run

flutter config --android-studio-dir="/snap/android-studio/current/android-studio"

Otherwise, run

flutter config --android-sdk="$HOME/Android/Sdk"
flutter config --android-studio-dir="/usr/local/android-studio"
  1. Install Dart and Flutter plugins in Android Studio and then Restart
  2. Switch to Flutter Beta Channel by running these commands

flutter channel beta

flutter upgrade

Run flutter doctor

Dharman
  • 30,962
  • 25
  • 85
  • 135
RandyKdev
  • 11
  • 2
1

The solution that worked for me is that I had to re-install AndroidStudio to a new location in a way that the full path to it contains no spaces, in the image below will you notice that flutter was cropping my full path because it contained a white space when I use the command flutter config --android-studio-dir C:\Program Files\Android\Android Studio

enter image description here

Mohammed A. Fadil
  • 9,205
  • 7
  • 50
  • 67
1

I had this problem because I downloaded a new AS version without uninstalling the old one first. During the download AS left the old program in place at C:\Program Files\Android\Android Studio and just created a new installation at C:\Program Files\Android\Android Studio1 (two installations next to each other??!! ).

I tried uninstalling AS (so I could do a fresh install) using the windows control panel but it said AS is already uninstalled?

So I had to run flutter config --android-studio-dir="C:\Program Files\Android\Android Studio1" to point to the new version i.e. Android Studio1. This solved the problem.

Mark
  • 370
  • 5
  • 10
0

In my case just renamed from AndroidStudio to Android Studio.app inside app folder cuz it was searching for separated words: Android Studio. Worked like a charm

0

I faced the same problem and solved by configuring android studio path manually. For my case the path was /opt/android-studio-4.1/android-studio

flutter config --android-studio-dir=/opt/android-studio-4.1/android-studio
Md Omar Faruk
  • 303
  • 3
  • 10
0

on windows, just add the path C:\Program Files\Android\Android Studio, in the environment variables

0

I use WSL on Windows 10 and I think that I was configuring flutter from WSL's command prompt. When I cleaned the flutter repo and tried to configure everything from PowerShell as administrator, it worked.

Oleg Yablokov
  • 736
  • 8
  • 19
0

On MacOS using Jetbrains Toolbox, I set it up as

flutter config --android-studio-dir "/Users/<myusername>/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/Android Studio.app"
biniam
  • 8,099
  • 9
  • 49
  • 58
0

For Mac:

If you have the android studio app under Application folder, the following command worked for me:

flutter config --android-studio-dir='/Applications/Android Studio.app'

(I was in /Users/ in the z shell)

0

I know this is an old issue but in case anyone still has issues getting flutter up and running like I did today here's what I did.

Windows 10

Once you install Android Studio you need to launch the editor for the first time and let it install a whole wack load of stuff (go get a coffee)

Note: I wasn't planning on using Android Studio so it didn't dawn on me to do this - bit of a duh moment.

Then go to File/Settings/Appearance & Behaviour/System Settings/ Select the SDK Tab and check off Android SDK Build Tools Click Apply and it will install it.

Open command line and run flutter doctor and you should now be good to go

Note: you may have to update the license - just use the provided command.

Hope this helps someone get up and running

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/34536741) – Pavan Kumar V Jun 18 '23 at 10:25
-2

flutter config --android-studio-dir="file path of android studio"

for example : in my case, my android studio in "E Drive "

flutter config --android-studio-dir="E:\Android\Android Studio"

Majid Hajibaba
  • 3,105
  • 6
  • 23
  • 55