其他分享
首页 > 其他分享> > Android使用阿里镜像

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
}

 

标签:content,jcenter,nexus,repositories,maven,阿里,镜像,Android,com
来源: https://www.cnblogs.com/wuren-best/p/12250357.html