Note: Recompile with -Xlint:deprecation for details.(Solved)

一个人想着一个人 提交于 2021-01-29 12:35:26

问题


Note: --:-----.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


回答1:


To solve this problem you need to go Gradle Scripts the click on build.gradle after buildscript you need to add

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

For example :

  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
 }


来源:https://stackoverflow.com/questions/61702748/note-recompile-with-xlintdeprecation-for-details-solved

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!