user223364
user223364

Reputation: 529

Android SDK is missing command line tools

I've installed flutter but when I run flutter doctor to verify the installation, I get:-

Android SDK is missing command line tools

I've doubled checked that the command lines are installed.

What do I need to do remove this error?

I've included the full flutter doctor -v output below:-

$ flutter doctor -v
    [✓] Flutter (Channel beta, v0.3.1, on Mac OS X 10.13.4 17E202, locale en-AU)
        • Flutter version 0.3.1 at /Users/chris/flutter
        • Framework revision 12bbaba9ae (2 weeks ago), 2018-04-19 23:36:15 -0700
        • Engine revision 09d05a3891
        • Dart version 2.0.0-dev.48.0.flutter-fe606f890b

[!] Android toolchain - develop for Android devices
    • Android SDK at /usr/local/Caskroom/android-platform-tools/27.0.1
    • Android NDK location not configured (optional; useful for native profiling support)
    • ANDROID_HOME = /usr/local/Caskroom/android-sdk/3859397
    ✗ Android SDK is missing command line tools;
    • Try re-installing or updating your Android SDK,
      visit https://flutter.io/setup/#android-setup for detailed instructions.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.3, Build version 9E145
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.0

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 24.1.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 24.1.2
    • Dart plugin version 181.4668.60

[!] Connected devices
    ! No devices available

! Doctor found issues in 2 categories.

Upvotes: 10

Views: 16892

Answers (4)

dd z
dd z

Reputation: 1

Please download the latest sdk build-tools to solve the problem of Android SDK is missing command line tools

Upvotes: -1

Dpedrinha
Dpedrinha

Reputation: 4230

On Android Studio open SDK Manager.

Go to SDK Tools tab.

Check if Android SDK Command-line Tools is checked. If not, check and apply the changes.

For some reason, after updating flutter and Android Studio, I got this error too. Seems like some new requirement that for some reason wasn't automatically installed.

This fixed it for me.

Upvotes: 23

Lông Nguyễn
Lông Nguyễn

Reputation: 11

Just solved the problem. Here are my system settings:

  • System variable ANDROID_SDK_ROOT points to my Android SDK dir
  • In system Path variable, I have sdk/tools, sdk/platform-tools, and /flutter-dir/bin

Also make sure you don't have dulplicated directories. I previously downloaded another platform-tools and add it to Path, so I had to delete it and use the sdk's one.

After changing those things, I close the flutter cmd windows and run flutter doctor on PowerShell. Worked like a charm!

Upvotes: 1

Napolean
Napolean

Reputation: 5543

I think ANDROID_HOME and ANDROID SDK should be pointing to the same path and that is the SDK's root directory.

In my .bashrc (on LINUX), following are

export ANDROID_HOME=/home/myname/Android/Sdk

export PATH=/home/myname/Android/Sdk:$PATH

export PATH=/home/myname/Android/Sdk/platform-tools:$PATH

export PATH=/home/myname/Android/Sdk/tools:$PATH

export PATH=/home/myname/Android/ndk-build:$PATH

Upvotes: 1

Related Questions