Steve A
Steve A

Reputation: 2013

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?

Upvotes: 92

Views: 89321

Answers (5)

Zain Ali
Zain Ali

Reputation: 15963

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)

Upvotes: 89

Mori
Mori

Reputation: 4641

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

 .\gradlew --warning-mode all

or

.\gradlew --stacktrace

Upvotes: 2

Paul Smith
Paul Smith

Reputation: 186

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"

Upvotes: 2

Vidyesh Churi
Vidyesh Churi

Reputation: 2589

Add this

org.gradle.warning.mode=all

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

Upvotes: 29

superjos
superjos

Reputation: 12695

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

Upvotes: 53

Related Questions