Note: --:-----\.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Asked
Active
Viewed 1.9k times
6

General Grievance
- 4,555
- 31
- 31
- 45

Mukta
- 1,357
- 1
- 15
- 17
-
1Does 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:31
-
https://stackoverflow.com/questions/18689365/how-to-add-xlintunchecked-to-my-android-gradle-based-project/34452265 This worked for me. (upvoted with 246 votes) – arg0nath Dec 29 '21 at 11:40
1 Answers
16
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
}

Mukta
- 1,357
- 1
- 15
- 17