Note: Recompile with -Xlint:deprecation for details
Asked Answered
B

2

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?

Butterwort answered 29/6, 2018 at 21:48 Comment(1)
Does this answer your question? Recompile with -Xlint in Android studioAvid
R
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"
    }
}
Romanfleuve answered 26/7, 2018 at 1:7 Comment(2)
unchecked option it is not required to solve the stated problem. Anyway problem solved, thanks.Butterwort
Yeah, I was in divided on whether to adjust for you question or just reproduce verbatim. I went with the latter.Romanfleuve
A
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"
                }
            }
Alternative answered 17/5, 2022 at 12:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.