PS:下载之前需要有Java环境,这里默认有Java环境。
下载Flutter SDK
https://flutter.dev/docs/development/tools/sdk/releases#windows 下载SDK
下载安卓SDK
https://www.androiddevtools.cn/ 下载SDK tools
Flutter 环境配置
- path 下载目录下的bin文件夹 flutter SDK 环境配置 SDK
- PUB_HOSTED_URL https://pub.flutter-io.cn
- FLUTTER_STORAGE_BASE_URL https://mirrors.sjtug.sjtu.edu.cn/
Android 环境配置
- ANDROID_HOME 安卓下载后解压后的目录
- path %ANDROID_HOME%platform-tools
问题描述
在flutter doctor 中出现如下信息
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
✗ Android license status unknown.
此时问题在于未知的安卓许可
解决办法
flutter doctor --android-licenses
当提示是否接受许可时,输入y确认即可
若报错,按照报错信息执行相关命令再返回执行此命令
若出现: Warning: An error occurred during installation: Failed to move away or delete existing target file: ***
PS: 请将您flutter中的tools文件夹修改名字后执行提示信息
执行完毕后再执行flutter doctor --android-licenses