AndroidStudio 编译报错 SSL peer shut down incorrectly

AndroidStudio 编译项目代码,之前是可以编译通过的,最近突然就报错了,报的错是 SSL peer shut down incorrectly,看这提示应该是网络的额问题,有可能某些jar包下载不下来,可以通过配置阿里的镜像仓库来解决网络下载慢的问题,在项目根目录的build.gradle 中添加阿里镜像仓库http://maven.aliyun.com/nexus/content/groups/public/,具体配置文件如下:

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

allprojects {
    repositories {
        google()
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        jcenter()
    }
}

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

 

你可能感兴趣的:(android开发)