添加Xlint:none即可。
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:none"
}
}
}