Deepin下Android Studio出现Received close_notify during handshake构建错误

错误

在deepin中第一次编译Android项目时出现:

javax.net.ssl.SSLException:Received close_notify during handshake

看得出是SSL连接问题。

解决办法

查阅资料大致有几种解决办法:

  1. 关闭防火墙
    但是deepin默认是没有防火墙,因此不推荐这种方法。
  2. 选用第三方源
    将项目的build.gradle文件中的jcenter()替换成:
maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' }
maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'}

即:

buildscript {
    ext.kotlin_version = '1.3.72'
    repositories {
        google()
        // jcenter()
        maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
        
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
allprojects {
    repositories {
        google()
        // jcenter()
        maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
    }
}

替换后点击Sync now,即可。

你可能感兴趣的:(Android)