why

When I opened AS today, I found that the compilation failed and the package could not be downloaded.

On second thought, maybe the net didn’t go over the wall. Can’t

Configure the agent of Ali cloud.

Ali Cloud agent:

buildscript {
    repositories {
        maven {
            url 'https://maven.fabric.io/public'
        }
        maven {
            url 'https://maven.aliyun.com/repository/jcenter'
        }
        maven {
            url 'https://maven.aliyun.com/repository/google'
        }
        maven {
            url 'https://maven.aliyun.com/repository/gradle-plugin'
        }
        mavenCentral() // add repository
    }
    dependencies {
        classpath 'com. Android. Tools. Build: gradle: 3.5.0'
    }
}

allprojects {
    repositories {
        maven {
            url 'https://maven.fabric.io/public'
        }
        maven {
            url 'https://maven.aliyun.com/repository/jcenter'
        }
        maven {
            url 'https://maven.aliyun.com/repository/google'
        }
        maven {
            url 'https://maven.aliyun.com/repository/gradle-plugin'
        }
        maven { url "https://jitpack.io" }
        mavenCentral() // add repository
    }
}

Copy the code

And then the headline was wrong.

I checked the log and found that the HTTPS connection failed

Finally, change all HTTPS to HTTP.

buildscript {
    repositories {
        maven {
            url 'http://maven.fabric.io/public'
        }
        maven {
            url 'http://maven.aliyun.com/repository/jcenter'
        }
        maven {
            url 'http://maven.aliyun.com/repository/google'
        }
        maven {
            url 'http://maven.aliyun.com/repository/gradle-plugin'
        }
        mavenCentral() // add repository
    }
    dependencies {
        classpath 'com. Android. Tools. Build: gradle: 3.5.0'
    }
}

allprojects {
    repositories {
        maven {
            url 'https://maven.fabric.io/public'
        }
        maven {
            url 'http://maven.aliyun.com/repository/jcenter'
        }
        maven {
            url 'http://maven.aliyun.com/repository/google'
        }
        maven {
            url 'http://maven.aliyun.com/repository/gradle-plugin'
        }
        maven { url "https://jitpack.io" }
        mavenCentral() // add repository
    }
}

Copy the code

Problem solving