在build.gradle中设置
allprojects {
gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" } }}
参考:
http://www.jianshu.com/p/6cf146b2c0eb
http://www.crifan.com/android_studio_build_osmand_warning_use_deprecated_api_for_detail_use_xlint_deprecation_rebuild/