Gradle 的依赖缓存可能已损坏(这有时发生在网络连接超时之后.) [英] Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

查看:44
本文介绍了Gradle 的依赖缓存可能已损坏(这有时发生在网络连接超时之后.)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了这种错误,如何解决.

错误:无法加载类org.gradle.tooling.internal.protocol.test.InternalTestExecutionConnection".此意外错误的可能原因 Gradle 的依赖项缓存可能已损坏(这有时发生在网络连接超时之后.)重新下载依赖项并同步项目(需要网络)Gradle 构建过程(守护进程)的状态可能已损坏.停止所有 Gradle 守护进程可能会解决这个问题.停止 Gradle 构建进程(需要重启)您的项目可能使用了第三方插件,该插件与项目中的其他插件或项目请求的 Gradle 版本不兼容.如果 Gradle 进程损坏,您也可以尝试关闭 IDE,然后终止所有 Java 进程.

解决方案

我将我的 Android Studio 更新到 2.3,它要求我将我的 gradle 插件更新到 3.3,这给我正在运行的项目带来了问题.我已经完成了所有的 Stack 解决方案,除了这个解决方法外,没有什么对我有用:我用这个更改了 gradle-wrapper.properties 中的分发网址.

distributionUrl=https://services.gradle.org/distributions/gradle-5.6.2-all.zip

(这里的永久链接列表:注意:发行版 gradle 将根据 android studio 的版本而变化.

I am getting this kind of error, how to fix it.

Error:Unable to load class 'org.gradle.tooling.internal.protocol.test.InternalTestExecutionConnection'.
Possible causes for this unexpected error Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

解决方案

I updated my Android Studio to 2.3 and it asked me to update my gradle plugin to 3.3 that created issues with my running projects. I've gone through all the Stack solutions and nothing worked for me except this workaround: I changed my distribution url in gradle-wrapper.properties with this one.

distributionUrl=https://services.gradle.org/distributions/gradle-5.6.2-all.zip 

(permanent link list here : https://services.gradle.org/distributions/)

My project is up and running.It just asked me to update to gradle build tools 25.0.0 which I did so. Everything is fine now :)

  1. Go to the project section and select gradle scripts menu.
  2. Under script, menu select gradle -wrapper.properties
  3. Then replace the distributionUrl=https://services.gradle.org/distributions/gradle-2.2-all.zip with "distributionUrl=https://services.gradle.org/distributions/gradle-3.4.1-all.zip"

note: distributions gradle will change depended upon the version of the android studio.

这篇关于Gradle 的依赖缓存可能已损坏(这有时发生在网络连接超时之后.)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆