Flutter HTTP Host Availability

HTTP Host Availability

错误提示如下,分析可知是 maven.google.com 访问失败造成的:

HTTP host https://maven.google.com/ is not reachable. Reason: An error occurred while checking the HTTP host: Operation timed out 

解决步骤:

  1. 打开/path-to-flutter-sdk/packages/flutter_tools/lib/src/http_host_validator.dart文件,修改https://maven.google.com/为 google maven 的国内镜像,如https://maven.aliyun.com/repository/google/
  2. 删除/path-to-flutter-sdk/bin/cache 文件夹
  3. 重新执行flutter doctor

参考: https://zhuanlan.zhihu.com/p/480002331

你可能感兴趣的:(Flutter HTTP Host Availability)