我试图将以下内容添加到build.gradle
根文件中:
subprojects {
gradle.projectsEvaluated {
tasks.withType(Compile) {
options.compilerArgs << "-Xlint:unchecked -Xlint:deprecation"
}
}
}
但是我得到这个:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Libraries:ActionBarSherlock:compileRelease'.
> invalid flag: -Xlint:unchecked -Xlint:deprecation
我究竟做错了什么?
最佳答案
这对我有用:
(在您项目的build.gradle中)
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}