Skip to content

flutter not finding my Android SDK (Request to display ANDROID_HOME in flutter doctor) #6516

Description

@sethladd
~/tmp/testpixel $ flutter doctor
[✓] Flutter (on Mac OS, channel master)
    • Flutter at /Users/sethladd/Code/flutter
    • Framework revision 80d578d93e (32 hours ago), 2016-10-23 17:20:38
    • Engine revision db12c5e621
    • Tools Dart version 1.21.0-dev.0.0

[x] Android toolchain - develop for Android devices
    x Android Studio / Android SDK not found. Download from https://developer.android.com/sdk/
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).

[✓] iOS toolchain - develop for iOS devices (Xcode 8.0)
    • XCode at /Applications/Xcode.app/Contents/Developer
    • Xcode 8.0, Build version 8A218a

[✓] Atom - a lightweight development environment for Flutter
    • flutter plugin version 0.2.4
    • dartlang plugin version 0.6.34

[✓] IntelliJ IDEA Community Edition (version 2016.2.5)
    • Dart plugin installed
    • Flutter plugin installed

[-] IntelliJ WebStorm (version 11.0.3)
    • Dart plugin not installed; this adds Dart specific functionality.
    • Flutter plugin not installed; this adds Flutter specific functionality.
    • For information about managing plugins, see
      https://www.jetbrains.com/help/idea/2016.2/managing-plugins.html

[✓] Connected devices
    • None

Yet I seem to have an SDK:

screen shot 2016-10-25 at 10 36 06 am

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Oct 25, 2016
  2. sethladd commented on Oct 25, 2016

    @sethladd
    ContributorAuthor
  3. sethladd commented on Oct 25, 2016

    @sethladd
    ContributorAuthor

    workaround: manually set ANDROID_HOME. But reading the docs, I get the sense that I shouldn't have had to do that?

  4. danrubel commented on Oct 25, 2016

    @danrubel

    If you remove ANDROID_HOME and run flutter doctor from the top level flutter repo directory, then does flutter doctor find your Android SDK install location? If you run it from another directory does it not work? That's what I'm seeing on my end after I ran brew install android-sdk... and brew uninstall android-sdk does not fix it.

    But then I closed the shell and reopend it and... viola! flutter doctor finds now finds the Android SDK regardless of the current directory. Does this work for you?

  5. sethladd commented on Oct 26, 2016

    @sethladd
    ContributorAuthor

    If you remove ANDROID_HOME and run flutter doctor from the top level flutter repo directory, then does flutter doctor find your Android SDK install location?

    No. And I'm not sure how/why it would? Does doctor look in a variety of common locations on a Mac?

    If you run it from another directory does it not work?

    I ran flutter doctor from $HOME, and it does not find my Android SDK:

    [x] Android toolchain - develop for Android devices
        x Android Studio / Android SDK not found. Download from https://developer.android.com/sdk/
          (or visit https://flutter.io/setup/#android-setup for detailed instructions).
    

    Does this work for you?

    Sorry, no. If ANDROID_HOME is not set, doctor cannot find the Android SDK.

    Where does doctor look for the SDK on a Mac?

  6. danrubel commented on Oct 26, 2016

    @danrubel

    If you remove ANDROID_HOME and run flutter doctor from the top level flutter repo directory, then does flutter doctor find your Android SDK install location?

    No. And I'm not sure how/why it would? Does doctor look in a variety of common locations on a Mac?

    I saw this because I was using two different shells... because I installed/uninstalled several times on one, it would work in one and broke in the other. Closing and reopening one caused flutter doctor to work again. I was hoping that was the issue for you, but no luck.

    Where does doctor look for the SDK?

    It looks for the SDK in the following locations

    • $ANDROID_HOME
    • $ANDROID_HOME/sdk
    • $homeDirPath/Library/Android/sdk <-- Mac only
    • $homeDirPath/Library/Android/sdk/sdk <-- Mac only
    • $homeDirPath/Android/Sdk <-- Linux only
    • $homeDirPath/Android/Sdk/sdk <-- Linux only

    Is your SDK in one of these locations? Or are there an additional locations I should check?

  7. sethladd commented on Oct 26, 2016

    @sethladd
    ContributorAuthor

    Interesting! Let's debug this in person :)

    On Wed, Oct 26, 2016, 10:30 AM Dan Rubel [email protected] wrote:

    If you remove ANDROID_HOME and run flutter doctor from the top level
    flutter repo directory, then does flutter doctor find your Android SDK
    install location?

    No. And I'm not sure how/why it would? Does doctor look in a variety of
    common locations on a Mac?

    I saw this because I was using two different shells... because I
    installed/uninstalled several times on one, it would work in one and broke
    in the other. Closing and reopening the one caused flutter doctor to work
    again. I was hoping that was the issue for you, but no luck.

    Where does doctor look for the SDK?

    It looks for the SDK in the following locations

    • $ANDROID_HOME
    • $ANDROID_HOME/sdk
    • $homeDirPath/Library/Android/sdk <-- Mac only
    • $homeDirPath/Library/Android/sdk/sdk <-- Mac only
    • $homeDirPath/Android/Sdk <-- Linux only
    • $homeDirPath/Android/Sdk/sdk <-- Linux only

    Is your SDK in one of these locations? Or are there an additional
    locations I should check?

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #6516 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AAAVZ_Yd_pAgxQSszYaSThHE1rXbUfCEks5q3w-MgaJpZM4KftBF
    .

  8. sethladd commented on Oct 27, 2016

    @sethladd
    ContributorAuthor

    DOH! ANDROID_HOME was set. To homebrew. Which I removed. :/

    perhaps we can display ANDROID_HOME in flutter doctor so that users like me will see that ANDROID_HOME is incorrect set.

    Thanks!

  9. changed the title [-]flutter not finding my Android SDK[/-] [+]flutter not finding my Android SDK (Request to display ANDROID_HOME in flutter doctor)[/+] on Oct 27, 2016
  10. UnaOmnia commented on Feb 15, 2018

    @UnaOmnia

    This is super hard. I read SO many of these vague comments...

    QUESTION:

    WHAT SHOULD ANDROID_HOME BE SET TO?

    I am GUESSING C:\Program Files\Android

    SAME QUESTION FOR ANDROID SDK FILES:

    I am GUESSING C:\Program Files\Android\android-sdk <-- PS that is just the zip you link to you your site extracted with \tools\ inside right?

    I am so freaking confused. 3rd open source app software I got stuck on recognizing the SDK tools with little to no coverage on instructions.

  11. UnaOmnia commented on Feb 15, 2018

    @UnaOmnia

    WAIT! I get it.. You have to download the SDK put it somewhere and then have Android Studio find and install it. That could be a bit more clear in the instructions....

    And I believe the answer is when you download the SDK zip from Android the folder "\tools" is the one you point it at - regardless of what you name \tools\ or where you put it, thats the one.

  12. meine31 commented on Apr 2, 2018

    @meine31

    Please someone help me with this issue; i did a ANDROID_HOME; but the flutter still not working; what kind of SDK we choose the android one or the one installed with flutter!!! A picture exemple would be great!!! Thx.

  13. ashishpatill commented on Apr 3, 2018

    @ashishpatill

    if i know my android sdk path, how do i update android_home to that path?

  14. KLTR commented on Mar 26, 2020

    @KLTR

    if i know my android sdk path, how do i update android_home to that path?

    depends on your MACOS.
    for zsh you need to create a new file named .zshrcand set the path. export $ANDROID_HOME=[PATH-TO-Android-SDK]
    if you use then you need to edit your .bashrc

  15. lock commented on Apr 26, 2020

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  16. locked and limited conversation to collaborators on Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

toolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions