AndroidStudio 配置阿里云镜像

2020-02-10  本文已影响0人  技术客栈

配置阿里云镜像

在平常的开发过程中。经常会遇到AndroidStudio 下载资源缓慢的情况。为此我们借助阿里云镜像辅助我们的日常开发工作。加速AndroidStudio 下载依赖资源包。再次作出记录。以供参考!

在项目配置如下:

▍阿里云镜像完整 maven

maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
//以下③ 个maven 非必须
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }

▍项目根目录build.gradle 文件配置

buildscript {
    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
    }
}

allprojects {
    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
        google()
        jcenter()
    }
}
上一篇下一篇

猜你喜欢

热点阅读