mac flutter环境变量配置
#android sdk 环境配置
export ANDROID_HOME="/Users/mac/Library/Android/sdk"
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
#flutter 环境配置
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/Users/mac/flutter/bin:$PATH
1.解决Android license status unknown. Try re-installing or updating your Android SDK Manager
1.运行flutter doctor 命令
2.错误内容
Android license status unknown.
Try re-installing or updating your Android SDK Manager.
是指: Android许可证状态未知。尝试重新安装或更新Android SDK管理器
解决方法:
/Users/mac/Library/Android/sdk/tools/bin/sdkmanager --update
2.[!] Network resources
[!] Network resources
✗ A network error occurred while checking "https://maven.google.com/":
Operation timed out
✗ An HTTP error occurred while checking "https://github.com/": Operation
timed out
其中 github 的问题,通过设置代理解决,github设置代理方式如下:
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890
marven的部分替换一个国内的源,替换步骤如下:
打开flutter根目录
打开文件 packages/flutter_tools/lib/src/http_host_validator.dart
修改其中 kMaven
const String kMaven = 'http://maven.aliyun.com/nexus/content/groups/public/';
删除 flutter/bin/cache
重新执行 flutter doctor
取消代理
git config --global --unset http.proxy
网友评论