Android使用阿里镜像

在学习room时项目一直在编译中,最后排查发现是依赖没有下载完导致。随后查询将依赖下载源改为阿里源,即可正常使用。

需要修改 build.gradle (project),改为以下内容:

// 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' }
        google()
        //jcenter()
        
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        
        // 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' }
        google()
        //jcenter()
        
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

 

posted @ 2020-02-01 21:52  Nevesettle  阅读(2945)  评论(0编辑  收藏  举报