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
}
本文介绍了解决AndroidStudio在编译项目时遇到的网络问题,特别是SSLpeershutdownincorrectly错误,通过配置阿里云镜像仓库加速依赖包下载。
7301

被折叠的 条评论
为什么被折叠?



