您的位置:首页 > 移动开发 > Android开发

解决android studio报Error:Gradle DSL method not fount: 'compile()'

2016-03-14 19:25 483 查看
本人还是一名android studio的菜鸟,今天使用AS时,由于误操作。AS一直无法编译通过,并且报Error:Gradle DSL method not fount: 'compile()'。

在网上找到办法也一直没有解决。

后来找到了一片stackoverflow上的提问,终于解决了。

解决方法:

1.找到自己项目的module下的build.gradle文件

例如:

2.找到文件中

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.2.0' compile files('libs/xutillibrary.jar')}


3.将compile那行进行换行

如下:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.2.0'
compile files('libs/xutillibrary.jar')}


4.重新编译下即可

是不是很简单?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: