[Flutter] flutter项目一直卡在 Running

2021-05-13  本文已影响0人  轻记事APP
第1步

首先将项目android目录下的build.gradle中google()和jcenter()替换成阿里镜像地址

maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }

BTbvYn.jpg
第2步

修改本地的flutter配置文件,flutter安装目录下找到packages/flutter_tools/gradle/flutter.gradle文件,repositories 修改为

maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }

将 MAVEN_REPO 地址替换为 https://storage.flutter-io.cn/download.flutter.io

BTqVYR.jpg
第3步

修改 packages/flutter_tools/gradle/resolve_dependencies.gradle,替换maven地址为 http://download.flutter.io

BTql0e.png
第4步

重新运行项目,等待一会就可以正常运行。

其他

Flutter 国内镜像 https://storage.flutter-io.cn/ 失效替换:https://www.cnblogs.com/hezhe666/p/14124374.html

上一篇下一篇

猜你喜欢

热点阅读