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:
- Checked the correct path to the sdkmanager executable.
- Verified the existence of the cmdline-tools component in the Android SDK installation directory.
- Ensured that the path to the sdkmanager executable is properly formatted without any typographical errors.
- Tried running the command from the correct directory but still encountered the same error.
- 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.
and also when i tried ./sdkmanager --install "cmdline-tools;latest"
it says
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
~/Library/Android/sdk/tools/bin/sdkmanager --install "cmdline-tools;latest"
Preferences → Appearance & Behavior → System Settings → Android SDK → SDK Tools → Android SDK Command-line Tools (latest)
Open
android studio
, open any existing project or create one. open itthen
tools
->SDK manager
,in side bar select
android sdk
-> in tab bar selectsdk tools
-> in the listselect Android SDK Command-line Tools
.then apply and click ok it will download.
then try flutter doctor.