在安装好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

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐