Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I just tried intalling flutter and since I already had android studio and the android sdk installed I just followed the installation of flutter. Here is my problem: When I run

flutter doctor

It tells me

  [√] Flutter (Channel beta, v0.1.5, on Microsoft Windows [Version 10.0.16299.248], locale en-US)
    • Flutter version 0.1.5 at C:\Users\Name\git\flutter
    • Framework revision 3ea4d06340 (2 weeks ago), 2018-02-22 11:12:39 -0800
    • Engine revision ead227f118
    • Dart version 2.0.0-dev.28.0.flutter-0b4f01f759
[X] Android toolchain - develop for Android devices
    X ANDROID_HOME = C:\Users\Name\AppData\Local\Android\sdk\Android
      but Android SDK not found at this location.
[√] Android Studio (version 3.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

Which tells me that flutter is not finding my Android sdk (even though it is the path that android studio uses aswell - and android studio is working fine)

I already tried reinstalling the sdk but it did not work.

Im very thankful for any help with this.

That works. Small addition. I found the sdk in the user folder of my windows 10 as follow : flutter config --android-sdk "C:\Users[your Local user folder]\AppData\Local\Android\Sdk" – Mustafamg Feb 27, 2019 at 5:43 yes, you need to enter it with the quotes. eg: flutter config --android-sdk "C:\Program Files (x86)\Android\android-sdk" – Kasun Wanniarachchi Mar 24, 2019 at 2:20 Why do we need to fix things that aren't wrong... can't they just add that statement during the setup? All those little things really annoy me. – html_programmer Dec 27, 2020 at 14:54 Your answer does not tell what a user should do. Your answer suggests that they should update all the SDK and tools according to your images. – Tony Lancer Dec 13, 2018 at 5:47 I'm not sure exactly which of these I performed that made flutter doctor finally prompt me to accept licences, but yes, now everything finally passes. I believe it may have been installing SDK platform api level 28, Android SDK tools (initial install only downloaded Platform-Tools. Once those were installed and I re-ran flutter doctor --android-licenses again, it all worked out. This process (to be able to develop Flutter) needs to be improved, imho. Is it worth the effort (rhetorical)? – user3232196 Feb 26, 2020 at 20:05 The accepted answer is particularly useful when android sdk was located somewhere other than the path specified in the flutter doctor error. By default, the answer above this comment should solve most android sdk issues with flutter. Keep sdk fully installed/updated as possible. Also, the accept licenses should be automatic. – Rod Maniego May 29, 2022 at 23:02

Choose the folder to install (I called it BASE_PATH) and use the following commands to install SDK with flutter:

Install SDK

cd $BASE_DIR
mkdir android-sdk
cd android-sdk
wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
unzip commandlinetools-linux-6200805_latest.zip
./tools/bin/sdkmanager --sdk_root=$(pwd) "build-tools;28.0.3" "emulator" "platform-tools" "platforms;android-28" "tools"

I used a separate folder for SDK, because it will add parent folders.

Install Flutter

cd $BASE_DIR
wget https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_v1.12.13+hotfix.8-stable.tar.xz
tar xvf flutter_linux_v1.12.13+hotfix.8-stable.tar.xz

Export Vars (you can add them to your .bashrc)

export ANDROID_SDK=$BASE_DIR/android-sdk
export ANDROID_PATH=$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools
export FLUTTER=$BASE_DIR/bin
export PATH=$PATH:$ANDROID_PATH:$FLUTTER

Check!

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.12.13, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] Android Studio (not installed)
[✓] VS Code (version 1.31.1)
[!] Connected device
    ! No devices available
! Doctor found issues in 2 categories.
                I had to do flutter config --android-sdk="$ANDROID_SDK" (github.com/flutter/flutter/issues/90042#issuecomment-919075876) to make it work
– Drdilyor
                Sep 19, 2021 at 15:25
                thanks....the best answer over the internet just pass the --sdk_root flag with every sdk manager commmand , and after installing build tools and command liine tools, just set the ANDROID_HOME env flutter reads that only
– ronit
                Jun 24, 2022 at 10:53

I have got following issue on Flutter Doctor command.

X Android SDK file not found: ..\Android\sdk\platforms\android-28\android.jar.

to fix this just go to Tools=> Android Sdk =>Update Sdk Platform for which issue is there.(I installed SDK 28).

check flutter document for this issue

The issue happens when the "latest" sdk platform found on the sdk directory was only partially installed or was incomplete and literally android.jar is not present. Make sure when you completely install any sdk platform for every new API you desire to use. – Rod Maniego May 29, 2022 at 23:07 Yes, this works, and it will 'revert' to the next 'latest' API level present in the platform directory. It can be fully fixed by installing partially install sdk platform package again in the SDK manager. – Rod Maniego May 29, 2022 at 23:09

I spent a lot of time solving this.

Eventually what worked was going to project settings in android studio, sdk tools, uncheck hide obsolete packages and install sdk tools obsolete package.

Then run flutter doctor --android-licenses and then flutter doctor showed a green tick on my android toolchain.

Hope this helps someone.

It was working fine yesterday, now the hell broke. I was able to fix it.

My issue was with ANDROID_HOME

// This is wrong. No idea how it was working earlier.
ANDROID_HOME = Library/Android/sdk 

If you did the same, change it to:

ANDROID_HOME = /Users/rana.singh/Library/Android/sdk 

.bash_profile has

export ANDROID_HOME=/Users/rana.singh/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
  • You will find the "Android SDK Location"
  • Copy the path and edit "the Environment Variable"
    After that, restart and run the command.
    Then, run "flutter doctor"
    Hope, it will work!

    Flutter say Sdk build tool version(exp:android toolchain - develop for android devices (android sdk 28.0.3)) version=28.0.3 go to home/username/Android/Sdk/build-tools delete this version(28.0.3) and fixed bug

    To open Tools=> Android Sdkenter image description here Click SDK tools tab => check show package details and check all 28 SDK version install that and to fix the issue

    Flutter is designed to use the latest Android version installed. So if you have an incomplete download of the latest Android, Flutter will try to use that.

    So either complete the installation or delete the complete installation. You can find the Android versions at: /home/{user}/Android/Sdk/platforms/android-29/android.jar

    Now open SDK manager, copy the SDK path. Open cmd

    cd C:\Users\your-username\AppData\Local\Android\Sdk\build-tools
    

    now again Change dir to the inner folder in build-tools. check the presence or the name issues of the aapt.exe file.

    I assume this is this known issue https://github.com/flutter/flutter/issues/13750

    You need to fix the path to the SDK manually until this is fixed in the file

    my_flutter_project/android/local.properties
    

    update

    Add $ANDROID_HOME\sdk\tools and $ANDROID_HOME\sdk\platform-tools to the PATH environment variable.

    First of all thatks a lot for your anwer. I did not exactly understand where the local.properties folder is located. – Stein. Mar 8, 2018 at 21:10 In you flutter project directors (my_flutter_project is the name I assumed) there is an android sub-directory that contains the file. – Günter Zöchbauer Mar 8, 2018 at 21:25 I have only one flutter project created which only contains one directory (called .idea) which contains one xml file (called workspace). When I created this project in android studio there where no files to access. – Stein. Mar 8, 2018 at 21:32 That dorsn't sound like you created it using flutter create. I guess you created it from the IDE and something went wrong. Can you try from command line? – Günter Zöchbauer Mar 9, 2018 at 4:39 Yes but I dont get why it tells me that it is not finding my sdk - since it is working with android studio and I even deleted it and re-downloaded it. The path is also the same that my newly downloaded sdk and android studio are using – Stein. Mar 9, 2018 at 8:00

    For me, adding the Android SDK path didn't help.

    I deleted all my SDKs (basically just deleted that Android folder. Used this path "C:\Users\your_user_name\AppData\Local\Android" to locate it.)

    I then reinstalled all the required SDKs using android studio. (Be sure to install more than 1 SDK, I don't know why it doesn't work if you only install 1).

    Then if I run Flutter Doctor, every thing works perfectly.

    You have to set ANDROID_HOME variable to SDK.

    Create a new variable by the name and set it to the installation directory.

    Make sure SDK is not below 2 subfolders from c drive or any windows root drive.

    I solved this problem by below step,

    1) go to -> system environment -> Environment Variables -> system Variable

    2) create New Variable Name ANDROID_HOME and Value D:\Androidsdk\tools (custom android sdk path).

    3) concat this path D:\Androidsdk\platform-tools in Path variable value using ";". (also in system Variable)

    4) that's all, Restart the PC to apply changes and try again -- flutter Doctor.

    Flutter provides a command to update the Android SDK path:

    flutter config --android-sdk < path to your sdk >
    

    If you are facing this issue --> sdk file is not found in android-sdk\build-tools\28.0.3\aapt.

    You may have probably not installed build tools for this Api level, Which can be installed through this link https://androidsdkmanager.azurewebsites.net/Buildtools

    This article explained how to solve it through Android Studio, since you don't need to install the SDK Manager separately when you use Android Studio. REFERENCE: https://flutter-examples.com/flutter-command-line-tools-component-is-missing/

  • Open Android Studio
  • More Actions >>> SDK Manager
  • Android SDK >>> SDK Tools
  • Check "Android SDK Command-line Tools (latest) >>> OK
  • Restart your command line window and run flutter doctor again to verify
  • I don't have Android Studio installed, only VS Code and extract sdk in C:\Android\.

    For solution, I'm set directly path:

    flutter config --android-sdk "C:\Android\cmdline-tools\latest\bin"
    

    I am using Visual Studio Code and Flutter 3.3.3. The above answers did not work for me. I followed the below steps to solve the problem:

  • Downloaded the latest Android command-line tools from https://developer.android.com/studio#command-tools

  • Unzipped the downloaded .zip file and went inside the extracted folder

  • Executed the below command in command-prompt (as administrator) to install the Android SDK packages:

    bin\sdkmanager.bat --sdk_root=<android_sdk_path> "build-tools;28.0.3" "emulator" "platform-tools" "platforms;android-29" "tools" "cmdline-tools;latest" "system-images;android-29;google_apis_playstore;x86"

    "system-images;android-29;google_apis_playstore;x86" is needed for adding device emulator

  • Set the Android SDK path for flutter:

    flutter config --android-sdk <android_sdk_path>

  • Accept the Android licenses for flutter:

    flutter doctor --android-licenses

    You are done. You can verify the installation using flutter doctor command. You should see something like this:

    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 3.3.3, on Microsoft Windows [Version 10.0.19044.2006], locale en-IN)
    [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    [√] Chrome - develop for the web
    [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.5)
    [!] Android Studio (not installed)
    [√] Connected device (3 available)
    [√] HTTP Host Availability
    ! Doctor found issues in 1 categories.
    If you get the following error,

    ANDROID_HOME = C:\Users\Name\AppData\Local\Android\sdk\Android
          but Android SDK not found at this location.
    
  • First go to android studio, Settings->System Settings->Click the expand arrow
  • Then go to the Android SDK option and add the corresponding SDK to the project then go to Project Structure and add the respective SDK to the project Structure
  • Then run flutter upgrade in the terminal
  • We need to manually add the Android SDK. The instructions in the flutter.io/download say that the Android Studio 3.6 or later needs the SDK to be installed manually. To do that,

  • Open the Android Studio SDK Manager
  • In the Android SDK tab, uncheck Hide Obsolete Packages
  • Check Android SDK Tools (Obsolete)
  • Please refer the Android Setup Instructions.

    What worked is Tools->Flutter->open Android module in Android studio, For me plugin flutter_email_sender was giving this error, so I copied local.properties file into it and the build become successful. Open Terminal Run touch ~/.bash_profile; open ~/.bash_profile

    export ANDROID_HOME=/Users/<macusername>/Library/Android/sdk
    export ANDROID_SDK_ROOT=/Users/<macusername>/Library/Android/sdk
    export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
    

    Run source ~/.bash_profile in android studio terminal

  • Step 1: In search type show hidden files and enable it.
  • Step 2: Go to C directoy> users>
  • Step 3: In that navigate to AppData>Local>Android>Sdk
  • Step 4: Copy the path to this folder
  • Step 5: Open power-shell and type in:
  • flutter config --android-sdk "C:\Users\<folder under your name>\AppData\Local\Android\Sdk"

    export ANDROID_HOME=$HOME/Development/android_sdk
    export PATH=$PATH:$ANDROID_HOME/platform-tools
    export PATH=$PATH:$ANDROID_HOME/tools
    export PATH=$PATH:$ANDROID_HOME/tools/bin
    export PATH=$PATH:$ANDROID_HOME/emulator
    export PATH=$PATH:$ANDROID_HOME/cmdline-tools
    export PATH=$PATH:$ANDROID_HOME/build-tools
    export PATH=$PATH:$HOME/pathto/flutter_sdk/bin
    

    `PWD this won't work I guess

    goes in .zprofile or .zshrc un the respective user directory of mac

    I tried the best answer but it didn't work for me.

    Running flutter doctor-v gave me a tip that worked.

    Just run flutter config --android-studio-dir=

    It will ask you to restart VS Code again.

    Delete the terminal in VS Code and restart VS Code.

    Run flutter doctor-v again and the issues was sorted for me.

    I tried many solutions and spent a lot of time then finally I removed the error by following steps-

  • [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) X Android SDK file not found: C:\Users\aksha\AppData\Local\Android\sdk\build-tools\30.0.3
  • delete this folder inside build-tools (because the error is not installed properly).
  • for resolving this issue, we have to uncheck all the latest plateforms (android (S)12 etc) and click apply after this restart the studio and check all these platforms again at least one latest and apply(ok).
  • Open Android Studio->files->Settings->Appearence & Behavior->System Settings->Android SDK->SDK plateforms(Latest)
  • run flutter command to accept the licenses. (type Y then enter for all) flutter doctor --android-licenses
  • run flutter doctor ( all is done).
  • Regards! Dinesh Prajapati

    I also have the same problem in windows, and It's come while authorizing android licenses. flutter doctor --android-licenseserror

    for resolving this issue we only have to install Android SDK command-line Tools(Latest) Open Android Studio->files->Settings->Appearence & Behavior->System Settings->Android SDK->SDK Tools->(install) Android SDK command-line Tools(Latest)

    This solves a different issue that might be found when command line tools is not present/not updated, but the question stated android studio (and sdk manager) was already installed. – Rod Maniego May 29, 2022 at 23:16 I implemented double queue(Deque) in C . Program exits immediately when I call deque_from_back() See more linked questions
  •