本人还是一名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.重新编译下即可
![]()
是不是很简单?