Android Studio 2023搭建Flutter开发环境
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,说明没连上设备,插上手机,再次重试命令即可。