posted @   思所匪夷  阅读(105)  评论(0编辑  收藏  举报  

Gradle同步失败Gradle's dependency cache may be corrupt

报错如下,原因是Gradle JVM的Java版本与build.gradle中sourceCompatibilitytargetCompatibility不一致,。兼容版本为11时,Gradle JVM需要选择Java11版本。

sourceCompatibility = 11
targetCompatibility = 11
class jdk.internal.loader.ClassLoadersPlatformClassLoadercannotbecasttoclassjava.net.URLClassLoader(jdk.internal.loader.ClassLoadersPlatformClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
class jdk.internal.loader.ClassLoadersPlatformClassLoadercannotbecasttoclassjava.net.URLClassLoader(jdk.internal.loader.ClassLoadersPlatformClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')

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.
posted @   思所匪夷  阅读(105)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
点击右上角即可分享
微信分享提示