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

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?



Solution 1:[1]

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:[2]

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:[3]

Add this

org.gradle.warning.mode=all

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

Solution 4:[4]

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"

Solution 5:[5]

In Gradle 7.3.3. , You can just write in the Terminal

 .\gradlew --warning-mode all

or

.\gradlew --stacktrace

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sascha N.
Solution 2 superjos
Solution 3 Vidyesh Churi
Solution 4 Paul Smith
Solution 5 Mori