android studio ,Gradle DSL method not found: 'compile()'

用gradle构建android工程出现  Gradle DSL method not found: 'compile()' 错误

检查你外层的build.gradle文件中是不是用了compile方法

什么是外层build.gradle文件,看下图

m0nnx0wr.ose

把这一堆compile搬到app目录下的build.gradle 的dependencies中,即可

其实你看看这上面的注释,他不就是说要你搬到你自己的app中嘛

原文地址:https://www.cnblogs.com/simoncook/p/4909801.html