• Flutter执行flutter doctor报错HTTP Host Availability


    问题描述

    [!] 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
    • 2
    • 3

    解决方案

    1. 将文件flutter/packages/flutter_tools/lib/src/http_host_validator.dart中的https://maven.google.com/改为https://dl.google.com/dl/android/maven2/
    % vim flutter/packages/flutter_tools/lib/src/http_host_validator.dart
    
    • 1
    1. 删除flutter/bin/cache
    % rm -fr flutter/bin/cache 
    
    • 1
    1. 执行flutter doctor
    % flutter doctor          
    Downloading Dart SDK from Flutter engine 57d3bac3dd5cb5b0e464ab70e7bc8a0d8cf083ab...
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  209M  100  209M    0     0  3968k      0  0:00:54  0:00:54 --:--:-- 3448k
    Building flutter tool...
    ╔════════════════════════════════════════════════════════════════════════════╗
    ║ A new version of Flutter is available!                                     ║
    ║                                                                            ║
    ║ To update to the latest version, run "flutter upgrade".                    ║
    ╚════════════════════════════════════════════════════════════════════════════╝
    
    
    Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure
    you trust this source!
    Downloading Material fonts...                                    2,003ms
    Downloading Gradle Wrapper...                                      112ms
    Downloading package sky_engine...                                  621ms
    Downloading flutter_patched_sdk tools...                         2,298ms
    Downloading flutter_patched_sdk_product tools...                 1,289ms
    Downloading darwin-x64 tools...                                    10.2s
    Downloading libimobiledevice...                                    118ms
    Downloading usbmuxd...                                              94ms
    Downloading libplist...                                             87ms
    Downloading openssl...                                             416ms
    Downloading ios-deploy...                                          107ms
    Downloading darwin-x64/font-subset tools...                        394ms
    Doctor summary (to see all details, run flutter doctor -v):
    [] Flutter (Channel stable, 2.10.5, on macOS 12.7.1 21G920 darwin-x64, locale
        zh-Hans-CN)
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
        ✗ cmdline-tools component is missing
          Run `path/to/sdkmanager --install "cmdline-tools;latest"`
          See https://developer.android.com/studio/command-line for more details.
        ✗ Android license status unknown.
          Run `flutter doctor --android-licenses` to accept the SDK licenses.
          See https://flutter.dev/docs/get-started/install/macos#android-setup for
          more details.
    [] Xcode - develop for iOS and macOS (Xcode 14.2)
    [] Chrome - develop for the web
    [] Android Studio (version 4.1)
    [] VS Code (version 1.56.2)
    [] Connected device (2 available)
    [] HTTP Host Availability
    
    ! Doctor found issues in 1 category.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
  • 相关阅读:
    ThreadLocal之强、弱、软、虚引用
    AIRIOT答疑第3期|如何使用物联网平台的可视化组态引擎?
    使用RoslynSyntaxTool工具互相转换C#代码与语法树代码
    时间跟踪工具:Timemator Mac汉化版
    KMP算法(题目)
    Redis(六) - Redis企业实战之商户查询缓存
    20min带你学习——HTTP协议、以及经典面试问题
    Nestjs配置服务,配置Cookie和Session
    短视频商城系统的技术架构与最佳实践
    Mybatis-Plus+SpringBoot结合运用
  • 原文地址:https://blog.csdn.net/libra_boy/article/details/134448252