Flutter环境搭建报错:What went wrong: A problem occurred configuring root project 'android'

window下,在AS中搭建Flutter环境,创建Flutter项目报错,报错信息如下:

文件加载失败,需要更换gradle文件中的镜像

  1. 找到.gradle文件

在这里插入图片描述

2 更改镜像

//更改镜像
repositories {
        //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'}
    }

    allprojects {
        repositories {
            //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'}
        }
    }

发布了18 篇原创文章 · 获赞 1 · 访问量 2313

猜你喜欢

转载自blog.csdn.net/Better_WZQ/article/details/103354524
今日推荐