此处为4.x级。我的build.gradle
文件中有以下声明:
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
我的理解是,这应该禁止所有与“未经检查”相关的编译器警告。但是,当我运行./gradlew clean build
时,仍然看到它们:
/Users/myuser/my-app/src/main/java/com/example/myapp/screens/DoSomethingScreen.java:56: warning: [unchecked] unchecked conversion
priceListListBox = getList("priceListListBox");
^
required: JList<String>
found: JList
1 warning
我该怎么做才能抑制这些警告,为什么我的Gradle声明无法按预期工作?