Unable to load class ‘org.gradle.initialization.BuildCompletionListener‘ org.gradle.initialization.B

一、报错日志

Unable to load class 'org.gradle.initialization.BuildCompletionListener'
org.gradle.initialization.BuildCompletionListener

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.

在这里插入图片描述

二、分析报错

首先,看到当前项目使用的是gradle-8.5-bin。

在这里插入图片描述
然后,看到Java版本是默认的17。

在这里插入图片描述
但是,gradle插件版本居然是3.6.1。很明显gradle版本、插件版本和Java版本不一致,导致上述报错。
在这里插入图片描述

三、解决报错

1、Gradle工具使用的Java版本改为JDK1.8,然后Apply和OK。
在这里插入图片描述

2、修改gradle版本为5.6.4,适配gradle插件版本3.6.1。

#Mon Dec 02 16:08:12 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://mirrors.cloud.tencent.com/gradle//gradle-5.6.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

3、再次Sync就可以看到项目在下载依赖了。

在这里插入图片描述
在这里插入图片描述

我强烈推荐4本可以改变命运的经典著作

  1. 《寿康宝鉴》在线阅读白话文
  2. 《欲海回狂》在线阅读白话文
  3. 《阴律无情》在线阅读白话文
  4. 《了凡四训》在线阅读白话文
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

振华OPPO

你的鼓励是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值