Android Studio的安装及"SSL peer shut down incorrectly"问题
文章目录
安装Android Studio
可参考:android studio的安装,史上最详细(超多图)!!
安装成功后、第一次运行程序会进行gradle,可能发生报错:SSL peer shut down incorrectly
"SSL peer shut down incorrectly"的解决方法
解决方法可参考:
①联网:AndroidStudio SSL peer shut down incorrectly 问题
②本地:Android Studio使用本地Gradle的配置
联网法
- 在侧边文件栏在
Gradle Scripts下找到build.gradle这个文件,双击编辑。 - 在以下两处添加
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } //此处添加
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } //此处添加
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}保存后,点击上方Try again或关闭Android Studio再打开,等待下载完成即可。
本地法
- 下载gradle到本地:下载gradle
- 将
gradle-wrapper.properties文件中最后一行distributionUrl=......修改如下:
distributionUrl=file:///路径如
distributionUrl=file:///D:/Android/gradle/gradle-6.8.1-all.zip- 将
build.gradle文件修改如下:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1" //这里不能改,就是Android Studio的版本,而不是gradle的版本
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}保存后,点击上方Try again或关闭Android Studio再打开,等待下载完成即可。

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论