关于android-studio: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的配置

联网法

  1. 在侧边文件栏在Gradle Scripts下找到build.gradle这个文件,双击编辑。
  2. 在以下两处增加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再关上,期待下载实现即可。

本地法

  1. 下载gradle到本地:下载gradle
  2. gradle-wrapper.properties文件中最初一行distributionUrl=......批改如下:
distributionUrl=file:///门路

distributionUrl=file:///D:/Android/gradle/gradle-6.8.1-all.zip
  1. 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再关上,期待下载实现即可。

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理