1 export PUB_HOSTED_URL=https://pub.flutter-io.cn
2 export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
3 flutter doctor
后面可能会遇到:
Running "flutter packages get" in try_flutter_app...
Connection failed (OS Error: No route to host, errno = 65), address = storage.googleapis.com, port = 443
通过上述方式同样可以解决。
下面是一次成功的运行过程输出的部分截图:
Downloading package sky_engine... 0.9s
Downloading common tools... 2.5s
Downloading darwin-x64 tools... 8.6s
Downloading android-arm-profile/darwin-x64 tools... 0.9s
Downloading android-arm-release/darwin-x64 tools... 1.4s
Downloading android-arm64-profile/darwin-x64 tools... 0.8s
Downloading android-arm64-release/darwin-x64 tools... 1.1s
Downloading android-arm-dynamic-profile/darwin-x64 tools... 1.0s
Downloading android-arm-dynamic-release/darwin-x64 tools... 0.9s
Downloading android-arm64-dynamic-profile/darwin-x64 tools... 1.0s
Downloading android-arm64-dynamic-release/darwin-x64 tools... 0.7s
Downloading android-x86 tools... 4.4s
Downloading android-x64 tools... 3.4s
Downloading android-arm tools... 1.6s
Downloading android-arm-profile tools... 1.3s
Downloading android-arm-release tools... 1.0s
Downloading android-arm64 tools... 1.8s
Downloading android-arm64-profile tools... 1.4s
Downloading android-arm64-release tools... 1.1s
Downloading android-arm-dynamic-profile tools... 2.0s
Downloading android-arm-dynamic-release tools... 1.4s
Downloading android-arm64-dynamic-profile tools... 1.9s
Downloading android-arm64-dynamic-release tools... 1.3s
Downloading ios tools... 7.3s
Downloading ios-profile tools... 6.9s
Downloading ios-release tools... 5.5s