Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.4, on Mac OS X 10.14.6 18G9323 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    ✗ Flutter requires a minimum Xcode version of 12.3.
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] IntelliJ IDEA Community Edition (version 2021.3)
[✓] VS Code (version 1.65.2)
[✓] 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

! Doctor found issues in 2 categories.

vi 修改一下文件

vi flutter/packages/flutter_tools/lib/src/http_host_validator.dart 

将里面的maven.google.com 修改为https://dl.google.com/dl/android/maven2/

还要删除cache的文件夹,

重新flutter doctor的时候,会重新下载dart 并且编译成功

ownloading Material fonts...                                       4.8s
Downloading Gradle Wrapper...                                      303ms
Downloading package sky_engine...                                2,600ms
Downloading flutter_patched_sdk tools...                            6.8s
Downloading flutter_patched_sdk_product tools...                    8.7s
Downloading darwin-x64 tools...                                    70.4s
Downloading libimobiledevice...                                    635ms
Downloading usbmuxd...                                             193ms
Downloading libplist...                                            189ms
Downloading openssl...                                           2,876ms
Downloading ios-deploy...                                        1,428ms
Downloading darwin-x64/font-subset tools...                         3.2s
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.4, on Mac OS X 10.14.6 18G9323 darwin-x64,
    locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    ✗ Flutter requires a minimum Xcode version of 12.3.
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] IntelliJ IDEA Community Edition (version 2021.3)
[✓] VS Code (version 1.65.2)
[✓] Connected device (1 available)
[✓] HTTP Host Availability

Logo

一站式 AI 云服务平台

更多推荐