第一次使用AndroidStudio创建项目卡在gradle sync需要在build.gradle配置国内镜像源

备份一个这个文件 以后直接copy进去完事儿 

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
        maven{ url 'https://maven.aliyun.com/repository/google'}
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
发布了66 篇原创文章 · 获赞 36 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/u013600907/article/details/99450741