skip to Main Content

I’m encountering an issue with the Android command-line tools, specifically the error message

"cmdline-tools component is missing."

I’m trying to install the necessary components for Android development using the command

path/to/sdkmanager --install "cmdline-tools;latest"

as mentioned in the official documentation.

However, when I run the command, I receive the following error message:

"zsh: no such file or directory: path/to/sdkmanager."

I have verified that the path to the sdkmanager executable is correct and have tried various approaches, but the error persists.

Here are the steps I’ve taken:

  1. Checked the correct path to the sdkmanager executable.
  2. Verified the existence of the cmdline-tools component in the Android SDK installation directory.
  3. Ensured that the path to the sdkmanager executable is properly formatted without any typographical errors.
  4. Tried running the command from the correct directory but still encountered the same error.
  5. I’m using [provide your operating system details], and I have already installed Java [provide your Java version details] for Android development.

i installed cmd-line tools.

enter image description here

enter image description here

and also when i tried ./sdkmanager --install "cmdline-tools;latest"
it says
enter image description here

here is the flutter doctor result

[✓] Flutter (Channel stable, 3.10.0, on macOS 13.3.1 22E772610a darwin-arm64, locale en-IN)
    • Flutter version 3.10.0 on channel stable at /Users/mishalhaneef/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 84a1e904f4 (6 days ago), 2023-05-09 07:41:44 -0700
    • Engine revision d44b5a94c9
    • Dart version 3.0.0
    • DevTools version 2.23.1

[✗] Android toolchain - develop for Android devices
    • Android SDK at /Users/mishalhaneef/homebrew/Caskroom/android-platform-tools/34.0.1
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.12.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.78.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.64.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.3.1 22E772610a darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 113.0.5672.92

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Any suggestions or insights on resolving this issue and successfully installing the Android command-line tools would be greatly appreciated. Thank you!

2

Answers


    1. ~/Library/Android/sdk/tools/bin/sdkmanager --install "cmdline-tools;latest"
        at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
        at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
        at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
    Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
        ... 5 more
    
    1. Install Android SDK Command-line Tools in Android Studio:

    Preferences → Appearance & Behavior → System Settings → Android SDK → SDK Tools → Android SDK Command-line Tools (latest)

    Login or Signup to reply.
  1. Open android studio, open any existing project or create one. open it

    then tools->SDK manager,

    like this
    in side bar select android sdk -> in tab bar select sdk tools -> in the list select Android SDK Command-line Tools.

    like this

    then apply and click ok it will download.

    then try flutter doctor.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search