环境变量配置就不用说了
- 进入文件~/. 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
- 重新执行flutter doctor