背景:导入一个别人的项目到自己的AndroidStudio中,然后遇到了Error:SSL peer shut down incorrectly,搞了两三天,终于解决了。在此,记录一下。希望对遇到同样问题的朋友,有所帮助
肯定的是,和AndroidStudio本身的版本没有太大的关系
1.遇到这个问题,可能是Gradle版本的问题
这个问题,在CSDN其他写博客的人都遇到的,比较好解决。大致就是,可能外网不能访问,
即:在Project中的gradle下wrapper中的gradle-wrapper.properties中,
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
,通过Setting,设置查看自己的Gradle使用的是关联远程的,还是本地的。这个关联可以选择本地的,可以通过
http://services.gradle.org/distributions/这个地址去下载对应的版本。然后放在对应的安装AS位置下的Gradle的包下。
可能叙述的不是很清楚,可以另行百度参考别人的。
2.我遇到的问题,其实是因为Google的一个地址无法访问,所导致出现的这个问题。
我在Project中的gradle中
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.3' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() maven { url "https://jitpack.io" } maven { url 'https://maven.google.com/' name 'Google' } } } task clean(type: Delete) { delete rootProject.buildDir } ext { versionCode = 1 versionName = '1.0' libMinSdkVersion = 14 appMinSdkVersion = 16 targetSdkVersion = 26 compileSdkVersion = 26 buildToolsVersion = '25.0.3' supportVersion = '25.3.1' libraryVersion = "1.0.3" }只需要把 其中的
maven { url 'https://maven.google.com/' name 'Google' }
改为
maven { url 'https://dl.google.com/dl/android/maven2/' name 'Google' }
再重新去编译,即可解决问题。
希望能解决你的问题