电脑配置Flutter SDK

发布于 16 天前  3 次阅读


1、下载Flutter SDK

https://flutter.dev/docs/development/tools/sdk/releases#windows

2、将下载好的文件解压到你想安装的目录中(F:\env\flutter)

20210712101641173

3、将Flutter 安装目录的 bin 目录配置到环境变量

20210712101732932

4、配置Flutter国内镜像(可跳过)

Flutter提供的国内镜像:
https://flutter-io.cn/
https://flutter.dev/community/china

Flutter中文网中有提供教程:
https://book.flutterchina.club/chapter1/install_flutter.html#_1-3-1-%E5%AE%89%E8%A3%85flutter

20210712101954966

在环境变量中添加:
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
PUB_HOSTED_URL: https://pub.flutter-io.cn

20210712102115400
20210712102143784

5、运行flutter doctor命令检查环境是否配置成功

20210712102433787
第一次运行时可能会提示:Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

解决方法:运行flutter doctor --android-licenses,然后一路y就行

如果提示报错:

20210712102649868

在android studio  ->  Android Sdk ->  sdk tools -> Android sdk Command-line tools 勾选 然后点击 apply下载

20210712102742324
报错:[X] Android Studio (not installed)

原因:安装了Android Studio,但路径为自定义,所以给Flutter指定Android Studio路径
解决方法:flutter config --android-studio-dir="F:\IDE\AndroidStudio"


平平无奇的大学在读本科生