android开发技巧一

android的一些常用包是发布在国外的,所以一些包,我们下载不下来,我们可以使用阿里云的镜像地址(maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' })。

使用https的地址,如下(亲测可用):

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

        maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
        google()
        mavenCentral()
        jcenter()
        maven { url "https://jitpack.io"}

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.0-rc01'
        classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
        classpath 'com.android.tools.build:gradle:7.1.2'


    }
}

allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
        google()
        mavenCentral()
        jcenter() // Warning: this repository is going to shut down soon
        maven { url 'https://jitpack.io' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}添加
02-12 14:05