Android studio 配置 Flutter 开发环境失败解决方案

注意,重点,不翻墙必挂,下载的域名是 googleapis.com ,我公司用的翻墙软件没翻这个域名,挂好几次了。
国内需要设置环境变量。

mac或linux

一行一行执行,别一起复制了,git如果没有安装,先安装git,要下载flutter sdk,最好先cd到一个目录。

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
git clone -b dev https://github.com/flutter/flutter.git
export PATH="$PWD/flutter/bin:$PATH"
cd ./flutter
flutter doctor

windows

PUB_HOSTED_URL https://pub.flutter-io.cn

FLUTTER_STORAGE_BASE_URL https://storage.flutter-io.cn

进入打算放置flutter sdk的目录,打开git bash

git clone -b dev https://github.com/flutter/flutter.git

配置环境变量

进入flutter目录,打开cmd或者powershell,别使用git bash

初始化,安装相关插件

flutter doctor