【发布时间】:2016-01-25 12:22:43
【问题描述】:
我正在使用 android Studio 2.0 preview 6 ,当我准备构建我的应用程序时遇到了这个问题
错误:(9, 0) Gradle DSL 方法未找到:'compile()' 可能的原因:
这是 build.gradle 文件
顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha5'
compile 'com.victor.ringbutton:lib:1.0.1'
NOTE: Do not place your application dependencies here; they belong
in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
任何帮助
【问题讨论】:
-
compile 'com.victor.ringbutton:lib:1.0.1'声明不应该在模块的 build.gradle 中吗?我不知道这是否能解决您的问题,但库不应该在项目 build.gradle 中声明。那里也有一张便条。