Mircea
Mircea

Reputation: 1999

Flutter doctor: cmdline-tools component is missing

OS: Ubuntu 21.10 Android-Studio: 2021.1.1 Flutter: 2.10.2

If I am running flutter doctor I will get the following output:

[✓] Flutter (Channel stable, 2.10.2, on Ubuntu 21.10 5.13.0-30-generic, locale en_US.UTF-8)
[✗] Android toolchain - develop for Android devices
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2021.1)
[✓] VS Code
[✓] Connected device (2 available)
[✓] HTTP Host Availability

! Doctor found issues in 2 categories.

But the thing is that I've installed cmdline-tools via android studio before running flutter doctor

enter image description here

And at the same time if I will run in terminal the sdkmanager I will get the fallowing message:

sdkmanager: command not found

Both of the programs were installed via snap install

snap install android-studio --classic

snap install flutter --classic

Does anyone know what I am doing wrong?

Upvotes: 8

Views: 29636

Answers (3)

4rmin
4rmin

Reputation: 380

Click on show package details then tick the all command line version and download all of them. Your problem will be solved.

Upvotes: 25

Deon Don
Deon Don

Reputation: 81

Mac OSX on M1 Silicon Chip

  1. Open Android Studio
  2. In the File Menu Go to Preferences or type in Command+,
  3. Click on Appearance and Behavior dropdown
  4. Click on System Settings dropdown
  5. Click on Android SDK
  6. In the window on the right look for the "SDK Tools" Tab it will be the second of three tabs.
  7. Click on SDK Tools
  8. Put a check mark in "Android SDK Command-line Tools (latest)"
  9. Wait till download completes

This Fixed the issue for me.

Upvotes: 8

Marcelo Cesar
Marcelo Cesar

Reputation: 178

try running the following line: path/to/sdkmanager --install "cmdline-tools;latest" and then run flutter doctor -v

if does not help try install the android-studio again by downloading the latest android-studio.deb file from the official site and install it: sudo tar -xvf file_name sudo mv android-studio /opt cd /opt/ && sudo ln -s /opt/android-studio/bin/studio.sh sbin/studio

and it's installed, ready to run

Upvotes: 0

Related Questions