1、安裝Plugins Flutter,搜尋出來,就點選Install。安完之後重啟Android Studio。
2、再到Plugins檢視Installed ,是否安裝成功了Flutter和Dart。
3、安裝Flutter SDK,下載地址:https://docs.flutter.dev/get-started/install/windows/mobile
4、配置sdk 的環境變數PATH
5、cmd 命令視窗執行 flutter doctor:用於檢查 flutter 相關工具的安裝資訊
可能會出現這種情況:
Command exited with code 128: git fetch --tags
Standard error: fatal: unable to access 'https://github.com/flutter/flutter.git/': Failed to connect to github.com port
443 after 2127 ms: Connection refused
等待一會,會繼續查詢
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
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/to/windows-android-setup for more details.
6、安裝android studio 的cmd-tools 工具
7、重新開啟一個cmd 視窗,輸入:flutter doctor --android-licenses
輸入Y 檢視沒有許可的工具。
8、接著再次輸入:flutter doctor, 如果有Device ** is offline,就說明沒連上裝置。