相关文章推荐
任性的数据线  ·  Microsoft Ajax CDN 上的 ...·  2 周前    · 
刚毅的灭火器  ·  GIT permission denied ...·  1 周前    · 
慈祥的针织衫  ·  C#/.NET/.NET ...·  4 天前    · 
道上混的豌豆  ·  Python ...·  11 月前    · 
从容的电梯  ·  c语言 --- printf time_t ...·  1 年前    · 

Android Studio 编译时出现如下问题 SSL peer shut down incorrectly 或者某些jar包下载不下来,一般是因为墙的原因导致的。

这时候我们就需要配置镜像来解决这个问题。

遇到这个问题,先备份工作项目,新建无关紧要的项目。

1、用阿里的远程仓库 ,如下

(为了提高jar包的下载速度也可以配置)配置的方法就是在根build.gradle中添加镜像仓库,

一般我们选择阿里的 http://maven.aliyun.com/nexus/content/groups/public/ 完整的如下所示

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:3.4.0'
        // 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

这里需要注意要将jcenter放到最后一个,因为他就是那个下载慢,或者报错的终极原因。

补充:可能会出现读取超时   Read timed out

在项目的build.gradle中 repositories 和 allprojects添加
...
mavenCentral()
maven { url 'https://maven.google.com' }
...

并将jcenter()放到这两个的下面

2、换用本地已下载好的gradle

http://services.gradle.org/distributions/

​​​​​

  • 复制到浏览浏览器能打开
  • 下一步 打开Android studio
  • gradle version 配置文件进行更改

将选中内容 替换成 http://services.gradle.org/distributions/

3、换成本地已有的gradle版本

构建项目出现 SSL peer shut down incorrectly,File——> Setting——>搜索Gradle,使用Use Local gradle distribution 
Gradle Home 从Android Studio安装的根目录中(D:\Software\Java\android\Android Studio\gradle)寻找。从其他电脑拷贝当前版本的gradle,将build.gradle的classpath更新成你AS相对应的版本。同时建议更新需谨慎,了解更新了什么之后掌握工具等相对稳定再更新工具。

以上第一种方法是亲测有效的(新建无关项目),但是在搜索中 还发现其他方法,再做补充。

参考 文章:

                  https.protocols的检测与设置

书到用时方恨少,纸上得来终觉浅。欢迎指正,有什么更好的解决办法欢迎留言。共勉

Android Studio 编译时出现如下问题 SSL peer shut down incorrectly 或者某些jar包下载不下来,一般是因为墙的原因导致的。这时候我们就需要配置镜像来解决这个问题。注意: 遇到这个问题,先备份工作项目,新建无关紧要的项目。1、用阿里的远程仓库,如下(为了提高jar包的下载速度也可以配置)配置的方法... maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } 2.把jcenter()放到最下边,调整依赖包下载的顺序 代码顺序如下: buildscript { repositories { google() mavenCentral()
前几天计算机重装系统了,当然一些软件都被清空了,包括今天的主角–Android Studio。 今天下载了一个2.3.3版本的试一下,结果新建第一个项目的时候一直出现该错误 SSL peer shut down incorrectly 通过百度查询发现出现的原因是由于Android Studio的Gradle构建项目出现了问题,大部分给出的修改意见是: File –> Settings –
Android Studio在首次安装创建项目的时候,出现“ERROR: SSL peer shut down incorrectly”错误,这是因为android studio在下载“gradle-4.10.1-all.zip”文件的时候出现的错误,错误原因是studio工具不支持https请求,如下这类型的网址: https\://services.gradle.org/distribut...
这个问题通常出现在Android Studio更新失败的时候,会在一开始建立项目的时候报错如下: 百度和谷歌之后知道是Gradle的配置有问题【接下来的蓝色字体部分是遇到的新问题,如果不瞎操作的话,直接跳到黑色字体部分继续阅读】 没弄懂自己的版本号究竟是多少的前提下,去Gradle的网站(http://services.gradle.org/distributions/)下载了最新版的Gr
Main Chain Protocol Checkpoint: Protection of History Block Signatures and Duplicate Stake Protocol Energy Efficiency Other Considerations Conclusion 1. 服务端或客户端证书验证失败,导致SSL握手失败; 2. SSL 握手过程中发生超时或其他网络异常,导致连接关闭; 3. SSL 握手时使用的协议版本或加密算法不被对方支持,导致连接关闭; 4. 服务器端存在安全漏洞,导致被攻击者利用,关闭了连接。 如果您是开发人员,可以尝试打开调试模式,查看 SSL 握手过程中的详细信息,以便更好地定位问题。如果您是用户,可以尝试联系网站管理员或应用开发者,以获取更多帮助。 Gradle‘s dependency cache may be corrupt (this sometimes occurs after a network connection timeout) 46668 * What went wrong: A problem occurred configuring project ':gradle-plugin'. > Could not resolve all files for configuration ':gradle-plugin:classpath'. > Could not download kotlin-compiler-embeddable-1.7.22.jar (org.jetbrains.kotli n:kotlin-compiler-embeddable:1.7.22) > Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains /kotlin/kotlin-compiler-embeddable/1.7.22/kotlin-compiler-embeddable-1.7.22.jar'. > Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotli n/kotlin-compiler-embeddable/1.7.22/kotlin-compiler-embeddable-1.7.22.jar'. Receiv ed status code 400 from server: Bad Request Android studio编译很久 Gradle Build Running特别慢问题解决 南宫Lemon: 完美解决:The specified Gradle installation directory 冷冷清清里风风火火是我: 合理翻墙用着也很方便。 完美解决:The specified Gradle installation directory HAC无聊写写: gradle最讨厌就是这点,还是maven用着舒服,虽然gradle功能多,但是作为一个构建工具,我并不想这么麻烦表情包 keytool 错误: java.io.IOException: Invalid keystore format 冷冷清清里风风火火是我: 具体情况,具体分析。