Installation of Android studio and “SSL peer shutdown incorrectly”

Time:2021-6-10

Install Android studio

For reference:The installation of Android studio is the most detailed in the history!!
After the installation is successful, the program will start gradle for the first time, and an error may occurSSL peer shut down incorrectly

The solution of “SSL peer shutdown incorrectly”

The solution can be referred to:
① Networking:Android studio SSL peer shutdown incorrectly
② Local:Android studio uses local gradle configuration

Networking method

  1. In the side file bar, in theGradle ScriptsFind it nextbuild.gradleThis file, double-click edit.
  2. Add in two placesmaven { 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/ '} // add here
        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/ '} // add here
        jcenter()
    }
}

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

After saving, click aboveTry againOr close Android studio and then open it, waiting for the download to complete.

Local law

  1. Download gradle locally:Download gradle
  2. takegradle-wrapper.propertiesThe last line in the filedistributionUrl=......It is amended as follows:
Distributionurl = file: // / path

as

distributionUrl=file:///D:/Android/gradle/gradle-6.8.1-all.zip
  1. takebuild.gradleThe document is amended as follows:
// 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 "// it can't be changed here. It's the Android studio version, not the gradle version
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

After saving, click aboveTry againOr close Android studio and then open it, waiting for the download to complete.

Recommended Today

The road of high salary, a more complete summary of MySQL high performance optimization in history

preface MySQL for many linux practitioners, is a very difficult problem, most of the cases are because of the database problems and processing ideas are not clear. Before the optimization of MySQL, we must understand the query process of MySQL. In fact, a lot of query optimization work is to follow some principles so that […]