在安装好flutter后运行flutter doctor时爆出一下错误:

Network resources     
X A network error occurred while checking "https://maven.google.com/":
An HTTP error occurred while checking "https://github.com/": 
信号灯超时时 间已到

其中 github 的问题,最好通过设置一个代理解决,github设置代理方式如下:

git config --global http.proxy http://127.0.0.1:7890

marven的部分最好替换一个国内的源,替换步骤如下:

打开flutter根目录
打开文件 packages/flutter_tools/lib/src/http_host_validator.dart
修改其中 kMaven(修改地址如下:http://maven.aliyun.com/nexus/content/groups/public/)
删除 bin/cache
重新执行 flutter doctor就没有报错了
 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐