Flutter not detecting Android SDK

24,248

Solution 1

Flutter provide command to update our Android SDK path:

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

Or just add a variable ANDROID_HOME with your sdk location in user variables

Solution 2

It turns out that I had NVIDIA CodeWorks installed. I believe it was part of my VS2017 installation options. I've removed it and modified my ANDROID_HOME Environment Variable and removed all of the variables associated with the NVPACK folder. (thanks to everyone (1) who helped me offsite!)

All good!

Solution 3

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.

Solution 4

Open Android Studio.

Click on Tools go to Sdk manager.

Then click on SDK tools.

enter image description here

Unchecked Hide Obsolete Packages then Check Android SDK Tools.

Then Tools will be install after that you can set the path and check the connectivity. Your problem will resolve.

Share:
24,248
Laserbeak43
Author by

Laserbeak43

Updated on July 18, 2022

Comments

  • Laserbeak43
    Laserbeak43 almost 2 years

    I've been trying to get flutter to detect the Android SDK.

    flutter doctor
    

    returns

    PS I:\Projects\Flutter\fluttertest\flutterproject> flutter doctor -v
    [√] Flutter (Channel beta, v0.1.5, on Microsoft Windows [Version 10.0.16299.248], locale en-US)
    • Flutter version 0.1.5 at I:\Source\flutter
    • Framework revision 3ea4d06340 (7 days ago), 2018-02-22 11:12:39 -0800
    • Engine revision ead227f118
    • Dart version 2.0.0-dev.28.0.flutter-0b4f01f759

    [!] Android toolchain - develop for Android devices
    • Android SDK at C:\NVPACK\android-sdk-windows
    • Android NDK location not configured (optional; useful for native profiling support)
    • ANDROID_HOME = C:\NVPACK\android-sdk-windows
    X Android SDK is missing command line tools; download from "link to google"
    • Try re-installing or updating your Android SDK, visit https://flutter.io/setup/#android-setup for detailed instructions.

    [√] 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)

    [√] VS Code (version 1.20.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Dart Code extension version 2.9.2

    [√] Connected devices (1 available)
    • Nexus 6P • 8XV7N16A04000597 • android-arm64 • Android 8.1.0 (API 27)

    ! Doctor found issues in 1 category.

    flutter doctor - output

    I've tried downloading the SDK Tools Package and even Installed Android Studio and added it to PATH, but was unable to resolve the issue.
    The current Android installation sits in a directory called C:\NVPACK, and although I do remember fiddling with it, I don't remember which program installed it. I'm considering removing it. Any help would be greatly appreciated.

    PATH Variable

  • Md. Juyel Rana
    Md. Juyel Rana over 4 years
    Thanks a lot to save my time.
  • Cold
    Cold over 2 years
    Simple and objective answer. Tks.
  • reza laki
    reza laki over 2 years
    by the "path" you mean android sdk (which has directory like platform-tools and so) or flutter sdk (which has directory like bin, dev and so)??
  • Mohammad
    Mohammad over 2 years
    @rezalaki like this C:\Users\Developer\AppData\Local\Android\Sdk
  • reza laki
    reza laki over 2 years
    got it, thank you
  • reza laki
    reza laki over 2 years
    @Mohammad you're welcome :)
  • Mohammad
    Mohammad over 2 years
    @rezalaki, you're welcome indeed! and it would be my honor that you upvote my answer if it helped you to solve your problem