我的Android进阶之旅------>解决Error:Could not find property ‘compile‘ on org.gradle.api.internal.artifacts.

这篇博客介绍了在Android开发中遇到的Error:Could not find property ‘compile‘错误,作者欧阳鹏分析了错误原因,并详细展示了如何通过修正build.gradle文件的代码排版来解决问题,从而恢复正常编译。
摘要由CSDN通过智能技术生成

文章目录


#1、错误描述
刚刚,Android Studio突然编译不了了,报了如下错误:

Error:Could not find property 'compile' on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@1b3472dc.

如下图所示:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jw3cNafC-1660293075347)(https://img-blog.csdn.net/20160707150924973)]

#2.解决方法
根据上面的提示,我去打开了build.gradle文件,发现我的build.gradle文件不知道被谁弄乱了,其中一段代码变成了如下所示:
##1、错误原因

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    //监测内存泄漏
    //    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3'
    //    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3'
    compile(name: 'common-release', ext: '
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

字节卷动

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

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

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

打赏作者

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

抵扣说明:

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

余额充值