拉取gradle项目报错Could not find method compile() for arguments

拉取gradle项目, 依赖拉不下来, 报错如下:

Could not find method compile() for arguments XXXXXX on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

 找了很多篇文章都没有解决,后来在stack overflow上面找到了答案:

Note that the compileruntimetestCompile, and testRuntime configurations introduced by the Java plugin have been deprecated since Gradle 4.10 (Aug 27, 2018), and were finally removed in Gradle 7.0 (Apr 9, 2021).

The aforementioned configurations should be replaced by implementationruntimeOnlytestImplementation, and testRuntimeOnly, respectively.

我的gradle是7之后了, 所以就是将compile改成implementation即可.

如下:

项目compile成功!!! 

参考文章:

java - Could not find method compile() for arguments Gradle - Stack Overflow

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值