flutter doctor –android-licensesで怒られた時




Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.

flutter doctorの結果はこんな漢字

 Doctor summary (to see all details, run flutter doctor -v):
 [✓] Flutter (Channel stable, 2.5.1, on macOS 11.1 20C69 darwin-arm, locale ja)
 [!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
     ✗ cmdline-tools component is missing
       Run `path/to/sdkmanager --install "cmdline-tools;latest"`
       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/docs/get-started/install/macos#android-setup for more details.
 [!] Xcode - develop for iOS and macOS
     ✗ CocoaPods not installed.
         CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
         Without CocoaPods, plugins will not work on iOS or macOS.
         For more info, see https://flutter.dev/platform-plugins
       To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
 [✓] Chrome - develop for the web
 [✓] Android Studio (version 2020.3)
 [✓] Connected device (1 available)

 ! Doctor found issues in 2 categories. 

Android toolchainのとこで何やら怒られている(cocoapodsはかんたんにインストールできるので無視で)


ここまで来たらAndroid Studioは入っているハズ、なのでAndroidStudioを起動する

起動したら画面上部のTools->SDK Managerをクリッコ

そしたらPreferenceのAndroidroid SDKのメニューが開くのでSDK Toolsタブをクリッポ

普通にpreferenceからAppearance & Behavior -> System Settings -> Android SDKでもこのメニュを開ける

そしたらAndroid SDK Command-line ToolsにチェックをいれてOK



これでもっかいflutter doctorを実行するとandroidの箇所はOKになるハズだ!