Как мы можем включить эти проверки lint через lint. xml on android
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Мой build.gradle содержит:
lintOptions {
lintConfig file("lint.xml")
warningsAsErrors true
}
Мой ворс. xml:
< issue id="MissingTranslation" severity="ignore" />
< issue id="ExtraTranslation" severity="ignore" />
< issue id="ValidFragment" severity="ignore" />
< issue id="GradleDependency" severity="ignore" />
< issue id="Deprecated" severity="error" />
< issue id="all" severity="error" />
Нет устаревшего использования API, как об ошибках, о которых следует сообщить warningsAsErrors true
. Кроме того, если я использую идентификатор проблемы "Deprecation" или "Unchecked" в lint. xml я получаю unknown issue id
ошибку от lint.
Я могу включить их, если передам их как compilerArgs, как показано ниже, но я хочу чтобы включить их из файла lint. xml, который уже используется:
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation" << "-Werror"
}
это можно включить в lintOptions / lint. xml in android? или они могут быть включены только путем передачи их как compileArgs для Java compile.