【问题标题】:Note: Recompile with -Xlint:deprecation for details.(Solved)注意:使用 -Xlint:deprecation 重新编译以获取详细信息。(已解决)
【发布时间】:2020-05-09 19:46:56
【问题描述】:

注意:--:-----.java 使用或覆盖了已弃用的 API。

注意:使用 -Xlint:deprecation 重新编译以了解详细信息。

【问题讨论】:

标签: gradle android-manifest


【解决方案1】:

要解决这个问题,你需要去Gradle Scripts点击build.gradlebuildscript 之后你需要添加

gradle.projectsEvaluated {
    tasks.withType(JavaCompile){
        options.compilerArgs << "-Xlint:deprecation"
    }
}

例如:

  buildscript {

     repositories {
         google()
         jcenter()
   }
   dependencies {
       classpath 'com.android.tools.build:gradle:3.6.3'
       classpath 'com.google.gms:google-services:4.3.3'

       // NOTE: Do not place your application dependencies here; they belong
       // in the individual module build.gradle files
      }
  }
    gradle.projectsEvaluated {
       tasks.withType(JavaCompile){
       options.compilerArgs << "-Xlint:deprecation"
     }
 }

   allprojects {
      repositories {
        google()
        jcenter()
    }
}

    task clean(type: Delete) {
     delete rootProject.buildDir
 }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-05
    • 1970-01-01
    • 2022-10-25
    • 1970-01-01
    • 2021-02-28
    • 2021-11-09
    • 1970-01-01
    相关资源
    最近更新 更多