1

Note: Some input files use or override a deprecated API. Note:

Recompile with -Xlint:deprecation for details.

I found many posts about this issue but none that says how to deal in android studio. Where i can set this system property in this IDE, for the project only?

Community
  • 1
  • 1
MiguelSlv
  • 14,067
  • 15
  • 102
  • 169
  • Does this answer your question? [Recompile with -Xlint in Android studio](https://stackoverflow.com/questions/47740812/recompile-with-xlint-in-android-studio) – lcnicolau Sep 10 '20 at 02:29

2 Answers2

2

I had the same question and found the answer elsewhere.

This answer says that it can be configured in Android Studio's settings under Build Execution -> Compiler -> Java Compiler -> Additional command line parameters, but I couldn't find the Java Compiler section with 3.1.3 even though the answer was for 3.1.2.

This answer explaining how to change the gradle files is what worked for me, reproduced below:

gradle.projectsEvaluated {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
    }
}
Jason Stubbs
  • 161
  • 1
  • 4
0

I add it to build.gradle(app) and it worked:

android {
   ...
   defaultConfig {
       ...
       javaCompileOptions {
           ...
           gradle.projectsEvaluated {
                tasks.withType(JavaCompile) {
                    options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
                }
            }
Amit
  • 53
  • 4