環(huán)境變量配置就不用說了
- 進入文件~/. bash_profile, 配置下面地址
export FLUTTER_HOME=/Users/用戶名/flutter
export PATH=$PATH:$FLUTTER_HOME/bin
export PATH=$PATH:$FLUTTER_HOME/bin/cache/dart-sdk/bin
export PATH="${DART_HOME}:${PATH}"
報錯 1.
command not found: flutter
解決
- 1顾瞪、指向source
source ~/.bash_profile
- 2挖函、運行
flutter doctor
報錯 2.
HTTP host "https://cloud.google.com/" is not reachable. Reason: An error occurred while checking the HTTP host: Operation timed out
解決
- 打開文件:/flutter/packages/flutter_tools/lib/src/http_host_validator.dart
- 刪除 /flutter/bin/cache 文件夾
- 重新指向source ~/.bash_profile
- 重新執(zhí)行flutter doctor