【flutter doctor HTTP host常见报错】HTTP Host availability check is taking a long time...

问题描述一:

HTTP Host availability check is taking a long time…[!] HTTP Host Availability

HTTP host “https://maven.google.com/” is not reachable.
Reason: An error occurred while checking the HTTP host: 信号灯超时时间已到
在这里插入图片描述

解决方案:

1、找到flutter sdk的文件目录,依次找到flutter/packages/flutter_tools/lib/src/http_host_validator.dart文件
2、将https://maven.google.com/ 修改为https://dl.google.com/dl/android/maven2/
在这里插入图片描述
3、关闭所有打开了flutterSDK的程序,找到flutter\bin目录下的flutter_tools.snapshot文件,永久删除。
在这里插入图片描述

4、Win+R运行cmd命令窗口执行 flutter doctor 问题解决。

问题描述二:

HTTP host "https://pub.dev/" is not reachable. 

解决方案:

配置国内的pub插件镜像地址,参数如下

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

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

笔者配置的是Flutter社区的镜像,更多镜像参考Flutter中文网
在这里插入图片描述

在这里插入图片描述

问题描述三:

HTTP host "https://cloud.google.com/" is not reachable. 

解决方案:

暂时未解决!!!