Add '--warning-mode all' command line argument in Android Studio

Android StudioGradle

Android Studio Problem Overview


I am getting the following message when I compile an Android Studio project:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.

How do I add the '--warning-mode all' command line setting to my Android Studio project so I can find the deprecated feature?

Android Studio Solutions


Solution 1 - Android Studio

Just create a file called gradle.properties in your root project:

root 
|--gradle.properties 
|--build.gradle 
|--app 
|----build.gradle

Then add inside that file:

> org.gradle.warning.mode=(all,none,summary)

Solution 2 - Android Studio

Please have a look at this older SO question, in particular this answer.

Just pasting the same picture here, but credits should go to original answer author:

Settings\Compiler, Command-line Options

Solution 3 - Android Studio

Add this

org.gradle.warning.mode=all

in Gradle Scripts -> gradle.properties(Project Properties) enter image description here

Solution 4 - Android Studio

This error is currently being caused by the shutdown of jcenter.

"The RepositoryHandler.jcenter() method has been deprecated. This is scheduled to be removed in Gradle 8.0. JFrog announced JCenter's shutdown in February 2021. Use mavenCentral() instead. Consult the upgrading guide for further information: https://docs.gradle.org/7.0.2/userguide/upgrading_version_6.html#jcenter_deprecation"

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSteve AView Question on Stackoverflow
Solution 1 - Android StudioZain AliView Answer on Stackoverflow
Solution 2 - Android StudiosuperjosView Answer on Stackoverflow
Solution 3 - Android StudioVidyesh ChuriView Answer on Stackoverflow
Solution 4 - Android StudioPaul SmithView Answer on Stackoverflow