最後更新日期: 2021 年 7 月 9 日

執行flutter doctor

安裝flutter於環境建置的時候

依照教學執行到開起flutter_console.bat中並執行flutter doctor時,相信大家可能執行完成之後,幾乎都會有[!],環境尚不符合的部分。當然我也遇到了~

[!] Android toolchain – develop for Android devices (Android SDK version 30.0.2)

X cmdline-tools component is missing

Run `path/to/sdkmanager –install “cmdline-tools;latest”`

See https://developer.android.com/studio/command-line for more details.

X Android license status unknown.

Run `flutter doctor –android-licenses` to accept the SDK licenses.

See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

Android toolchain – develop for Android devices (Android SDK version 30.0.2) 解法

Android Studio中,點擊SDK Manager

  1. 側邊選擇Android SDK
  2. 右邊切至 SDK tools頁籤
  3. 勾選 Android SDK Command-line Tools(latest)
  4. 選擇Apply安裝

再次執行flutter doctor,沒問題後就完成環境建置。

點閱: 59