You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter克隆成功后执行flutter doctor无结果的问题求助

Fixing flutter doctor Hanging Indefinitely on Mac OS X 10.13.4

Hey there, sorry to hear you're stuck with flutter doctor hanging for over an hour after cloning the Flutter repo—let's dive into some targeted fixes that might resolve this, especially since you've already tried switching branches and public IPs.

Potential Solutions to Try

1. Use Official Flutter Mirrors for Regional Connectivity

Since you're connecting from Spain, regional network restrictions or DNS issues might be blocking Flutter's background dependency downloads. Try setting these environment variables to use official mirrors, then re-run the command:

export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PUB_HOSTED_URL=https://pub.flutter-io.cn
flutter doctor

These mirrors are optimized for better access in regions where default Flutter resources might be slow or blocked.

2. Verify Xcode Compatibility & License Agreement

Mac OS X 10.13 (High Sierra) only supports up to Xcode 9.4.1—newer Xcode versions won't run on your system, and this mismatch can cause silent hangs in flutter doctor.

  • First, install Xcode 9.4.1 (available in Apple's developer archives)
  • Install or update Xcode command-line tools:
    xcode-select --install
    
  • Open Xcode at least once to accept the license agreement—silent license prompts are a common culprit for hanging CLI tools.

3. Wipe Corrupted Cache & Reinitialize the Repo

Cached or corrupted files from previous attempts might be causing the hang. Run these commands in your Flutter repository directory to reset everything:

git clean -xfd
git pull
flutter doctor

git clean -xfd removes all untracked files, including cached dependencies, ensuring you start with a fresh state.

4. Disable Local Firewall/Proxy Tools

High Sierra's built-in firewall or background proxy/VPN tools could be blocking Flutter's network requests:

  • Go to System Preferences > Security & Privacy > Firewall and temporarily turn it off to test
  • Quit any VPN, proxy, or ad-blocking tools running in the background (even ones you forgot were active!)

5. Manually Install Dart SDK

If the automatic Dart SDK download is the bottleneck, you can download it manually and point Flutter to it:

  1. Download the Dart SDK version compatible with your Flutter branch from the official Dart archive
  2. Extract the SDK to a directory on your Mac
  3. Set the DART_SDK environment variable and run flutter doctor:
    export DART_SDK=/path/to/your/extracted/dart-sdk
    flutter doctor
    

If All Else Fails

Try running flutter doctor -v—even if it hangs, it might output partial logs that show exactly where the process is getting stuck. You can also use strace (install via Homebrew with brew install strace) to trace system calls:

strace flutter doctor

This will show every system operation the command is trying to perform, which can help pinpoint the root cause (e.g., a specific file or network request that's timing out).

内容的提问来源于stack exchange,提问作者benLIVE

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 07:53:49