MENU

Flutter - “cmdline-tools component is missing”

If you already install adb or command-line-tools before, you will found error like this when you first install flutter.

Running result of flutter doctor:

20220506154034.png

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

How to solve:

  • Set PATH ANDROID_SDK_ROOT
export ANDROID_SDK_ROOT="path/to/android\ sdk/"
  • Set config to flutter within Terminal
flutter config --android-sdk path/to/android\ sdk/

All set!


PS: Recommand to set both above.