美文网首页
[Flutter] flutter项目一直卡在 Running

[Flutter] flutter项目一直卡在 Running

作者: 轻记事APP | 来源:发表于2021-05-13 14:44 被阅读0次
    第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

    相关文章

      网友评论

          本文标题:[Flutter] flutter项目一直卡在 Running

          本文链接:https://www.haomeiwen.com/subject/fbtxjltx.html