文章目录
#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: '