I am trying to get flutter/android studios to work on linux and i am having an issue getting flutter to recognize my android-studio location.

I am able to run android-stuio, but when i try to tell flutter my install location via the android-studio-dir param i get something that doesn't work.

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.27.0-2.0.pre.78, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio
    ✗ android-studio-dir = ~/Downloads/android-studio/bin/
    ✗ Android Studio not found at ~/Downloads/android-studio/bin/
[✓] VS Code (version 1.53.1)
[!] Connected device
    ! No devices available

At location ~/Downloads/android-studio/bin/ i have the bin directory of my android studio install. This obviously doesn't work.

I have tried to look up what directory android-studio-dir needs to point at and it seems that i wants to point at a directory like /path/to/android/studio.

but in my install directory i dont have a studio directory to point at?

So my question is what should android-studio-dir point at?

I am able to run android studio by ./~/Downloads/android-studio/bin/studio.sh

So i am fairly confident i have android studio "installed" correctly.


Solution 1: Doc

the commands are

flutter config --android-sdk="/home/user/Android/Sdk"

flutter config --android-studio-dir="/usr/local/android-studio"

Don't use the bin folder, just mark the root folder for both the sdk and the IDE. Also, use complete path.


Solution 2: novas1r1

For windows the commands are same like those from @Doc but take care of the slashes:

flutter config --android-sdk="C:/TestFolder/AndroidSDK"
flutter config --android-studio-dir="C:/Program Files/Android/Android Studio"


Solution 3: user15507542

A. To resolve your unrecognized sdk. issue, use following steps

  1. Find your dir. location. You will find at same place

C:\users\UserName\AppData\Local\Android\SDK

Mine was at

C:\Users\SHARM\AppData\Local\Android\Sdk

  1. Go to PowerShell and type

flutter config --android-sdk "C:\users\UserName\AppData\Local\Android\SDK"

Change your Username above

PowerShell screenshot showing how I resolved unable to locate SDK issue

B. To resolve dir issue, type

flutter config --android-studio-dir "type directory name"

In my case, it was

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

C. I have license issue so I am sharing here if in case you encounter it after fixing SDK and dir issue.

C.1 Open you Android Studio

C.2 On main screen, Click Advanced > SDK Manager

SDK Manager

C.3 Select SDK Tools

Check Android SDK Command-line tools and click ‘apply’. Check Android SDK Command-line tools and click ‘apply’

C.4 Click Apply.

C.5 Your license issue will be resolved. You can test it by again going to PowerShell and type

flutter doctor You will pass all tests like I did in photoflutter passed all tests

If you want to check your configurations for SDK, dir etc, just type flutter config and it will show you all configurations.