Flutter doctor报错:HTTP Host Availability,checking the HTTP host: Operation timed out

前言

在不同的电脑安装flutter就会遇到不同的问题,这会又遇到一个问题:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.1, on macOS 11.4 20F71 darwin-x64, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version
    32.1.0-rc1)
[!] Xcode - develop for iOS and macOS (Xcode 12.5.1)
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] Connected device (1 available)
[!] HTTP Host Availability
    ✗ HTTP host https://maven.google.com/ is not reachable. Reason: An error
      occurred while checking the HTTP host: Operation timed out
解决方法:
1、通过vi打开host文件
sudo vi /etc/hosts
2、这时候输入你的密码打开文件,输入i,进入编辑模式
3、添加域名以及IP地址
192.30.253.112 github.com
172.217.160.78 maven.google.com

Flutter doctor报错:HTTP Host Availability,checking the HTTP host: Operation timed out_第1张图片

4、编辑完成后ESC退出编辑
5、:wq+回车保存
6、重新执行flutter doctor 解决问题!!!

END.

你可能感兴趣的:(flutter,flutter,http,网络协议)