android阿里云镜像

gradle同步特别慢,网上收集的几种方法。

android/build.gradle

repositories {
       maven { url ‘https://maven.aliyun.com/repository/jcenter‘ } 
       maven { url ‘https://maven.aliyun.com/repository/google‘ } 
       jcenter() 
       google() 
}

第二个比较完整,推荐

buildscript {
    ext.kotlin_version = ‘1.2.71‘
    repositories {
    	// 以下四行代码为阿里gradle 源
        maven{ url ‘https://maven.aliyun.com/repository/google‘}
        maven{ url ‘https://maven.aliyun.com/repository/gradle-plugin‘}
        maven{ url ‘https://maven.aliyun.com/repository/public‘}
        maven{ url ‘https://maven.aliyun.com/repository/jcenter‘}
        google()
        jcenter()
    }
    dependencies {
        classpath ‘com.android.tools.build:gradle:3.2.0‘
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
    	// 所有的model 都优先使用阿里源
        maven{ url ‘https://maven.aliyun.com/repository/google‘}
        maven{ url ‘https://maven.aliyun.com/repository/gradle-plugin‘}
        maven{ url ‘https://maven.aliyun.com/repository/public‘}
        maven{ url ‘https://maven.aliyun.com/repository/jcenter‘}
        google()
        jcenter()
    }
}

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

  

android阿里云镜像

上一篇:vue less scope的样式中添加全局样式,或者针对本页面的 html body等app外层元素添加样式的一些方法


下一篇:H5开发移动应用APP(店铺系列一)