Home » Android » Where is the output of ProGuard's -whyareyoukeeping in Android Studio?

Where is the output of ProGuard's -whyareyoukeeping in Android Studio?

Posted by: admin June 15, 2020 Leave a comment

Questions:

I am using ProGuard in the gradle settings of my app in Android Studio. In the “Gradle Console” window I am able to read warnings from proGuard. However, when I use the whyareyoukeeping, nothing is diplayed there. Am I missing something?

Here’s an example of the way I tried to use it:

-whyareyoukeeping class com.google.android.gms.internal.zzel
How to&Answers:

I figured that if I add the “–info” flag in the command-line options of Gradle, then all the output of ProGuard is displayed in Gradle console.

Android Studio -> Project Settings

Answer:

Just for the record:

For example, add the following option:

-whyareyoukeeping class **.MyApplication

Then open the Gradle Console tab (down on the right) and run “Build” > “Build SDK”. During the building, you’ll see (or will be able to look for them later) lines like these printed:

Shrinking...
Explaining why classes and class members are being kept...

your.package.name.MyApplication
  is kept by a directive in the configuration.

If you don’t find these lines, maybe you should add --info, to Gradle Console command-line options, as Petrakeas specified, restart Android Studio and try again.

Answer:

You have to check “generic” in the filters of the Messages panel.

enter image description here