If you see the error “cmdline-tools component is missing”, it usually happens when Android Studio or the Android SDK cannot find the Android SDK Command-line Tools.
Here are the ways to fix it depending on your setup:


Fix 1 — Install cmdline-tools using Android Studio (Recommended)

  1. Open Android Studio
  2. Go to Settings / Preferences → Appearance & Behavior → System Settings → Android SDK
  3. Open SDK Tools tab
  4. Check Android SDK Command-line Tools (latest)
  5. Click ApplyOK

Fix 2 — Install via sdkmanager (if SDK is already installed)

Run this in your terminal / command prompt:

sdkmanager --install "cmdline-tools;latest"

On Windows, you may need to run from:

C:\Users\<you>\AppData\Local\Android\Sdk\tools\bin\sdkmanager.bat

Fix 3 — Manually fix folder structure

Sometimes tools are installed but folder names are wrong.

Check your SDK location:

  • Windows: C:\Users\<you>\AppData\Local\Android\Sdk
  • macOS: ~/Library/Android/sdk
  • Linux: ~/Android/Sdk

Inside sdk/cmdline-tools, you should have:

cmdline-tools/
   latest/
      bin/
      lib/

If instead you see something like:

cmdline-tools/
   tools/
      bin/
      lib/

Rename tools → latest:

cmdline-tools/tools  ➜  cmdline-tools/latest

Fix 4 — Set ANDROID_HOME or ANDROID_SDK_ROOT correctly

Add to your environment variables:

Windows (PowerShell):

setx ANDROID_SDK_ROOT "C:\Users\<you>\AppData\Local\Android\Sdk"

macOS/Linux (bash/zsh):

export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
Categories: Tech Post

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *