注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用了未经检

919 阅读1分钟

项目级build.gradle中=添加
//检测项目中已过时API

allprojects {

    gradle.projectsEvaluated {

        tasks.withType(JavaCompile) {

            options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"

        }

    }

}

屏蔽警告方法,在app目录的build.gradle下添加:

android {

  lintOptions {

      checkReleaseBuilds false

      abortOnError false

  }

}

image.png