Ed Dunn
Ed Dunn

Reputation: 1172

Gradle: List deprecated features

I am getting a warning about the usage of deprecated features in my build.
Is there a way to list all the deprecated features so that I may go through and update my code?

*clarification

I know I can go to the Gradle documentation and see what is now deprecated, what I would specifically like is a way to go through MY code and list MY deprecated features.

Upvotes: 28

Views: 35264

Answers (4)

tangens
tangens

Reputation: 675

In order to change the warning verbosity level in the Android Studio IDE, you can add the option org.gradle.warning.mode=(all,none,summary) to the gradle.properties file, which can be found in the root directory of your project.

Add following line to set the warning mode to all:

...
org.gradle.warning.mode=all
...

Upvotes: 19

Hugo Allexis Cardona
Hugo Allexis Cardona

Reputation: 1432

I just faced the exact same problem and running the Gradle build task every time through the command line wasn't the best option for me because, during development, I usually just use the built-in Gradle build task run, so:

I know I can go to the Gradle documentation and see what is now deprecated, what I would specifically like is a way to go through MY code and list out MY deprecated features.

You can do this by adding the mentioned --warning-mode=all flag to your gradle command line options in your Android Studio settings:

enter image description here This will print the proper warnings for you to be aware of what are the specific deprecated features your app is using.

Also, I know you asked this near a year ago, but, it might be useful for other people facing the same issue.

Upvotes: 40

Mukesh Chauhan
Mukesh Chauhan

Reputation: 821

  1. Go to the build.Gradle (Module) file.
  2. replace Compile with implementation.
  3. Sync the gradle file and you will not receive the warning again.

Upvotes: 0

VaL
VaL

Reputation: 1167

Use Gradle option -Dorg.gradle.warning.mode=(all,none,summary) to control verbosity, for example, mode all will log all warnings with detailed descriptions:

./gradlew build -Dorg.gradle.warning.mode=all

More details can be found in the official documentation: Showing or hiding warnings

Upvotes: 12

Related Questions