安装过程中输入 flutter doctor 报错:

Error: The Flutter directory is not a clone of the GitHub project.
       The flutter tool requires Git in order to operate properly;
       to set up Flutter, run the following command:
       git clone -b beta https://github.com/flutter/flutter.git

解决方法

在flutter根目录下手动创建一个 .git 文件夹
再次执行 flutter doctor,开始安装

安装过程中可能遇到报错 Error: Unable to 'pub upgrade' flutter tool
此时,只需在环境变量 -> 用户变量中添加下面两个变量

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

配置变量
配置变量

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐