Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android SDK is missing command line tools

Tags:

flutter

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.
like image 708
user223364 Avatar asked Apr 17 '26 06:04

user223364


2 Answers

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.

like image 63
Dpedrinha Avatar answered Apr 19 '26 04:04

Dpedrinha


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
like image 20
Napolean Avatar answered Apr 19 '26 04:04

Napolean