sodol-dotcom

[Troubleshooting] Flutter 개발 환경 세팅 중 Android SDK 오류 발생 및 해결 과정 정리(cmdline-tools component is missing) 본문

Troubleshooting

[Troubleshooting] Flutter 개발 환경 세팅 중 Android SDK 오류 발생 및 해결 과정 정리(cmdline-tools component is missing)

sod0l 2025. 7. 6. 17:56

1. 오류 메시지

sodol@macpro ~ % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.5, on macOS 15.3.1 24D70 darwin-arm64, locale
    ko-KR)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
    ✗ cmdline-tools component is missing.
      Try installing or updating Android Studio.
      Alternatively, download the tools from
      https://developer.android.com/studio#command-line-tools-only and make sure
      to set the ANDROID_HOME environment variable.
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/macos-android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.

해석:

  • cmdline-tools component is missing
    • Android SDK에서 명령어 기반 도구(command-line tools)가 누락됐다는 뜻
    • flutter가 Android 빌드, 디바이스 연결 등을 위해 내부적으로 cmdline-tools에 포함된 여러 도구들(sdkmanager, avdmanager 등)을 사용하는데, 이게 없으면 Flutter에서 Android 관련 작업을 할 수 없다.
    • 해결 방법: Android Studio를 통해 SDK Manager에서 cmdline-tools 설치, 설치 후 ANDROID_HOME 환경 변수도 올바르게 설정해야 함
  • Android license status unknown
    • Android SDK의 라이선스를 아직 동의하지 않았거나 SDK가 정상적으로 설치되지 않았기 때문에 상태를 확인할 수 없음을 뜻함.
    • 해결 방법: 터미널에서 다음 명령어 실행. 여러 항목에 대해 `y`를 입력하며 동의하면 된다.
flutter doctor --android-licenses