Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 917
Petrakeas Avatar asked Sep 17 '15 14:09

Petrakeas


2 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

like image 140
Petrakeas Avatar answered Oct 20 '22 00:10

Petrakeas


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.

like image 30
Juan José Melero Gómez Avatar answered Oct 20 '22 00:10

Juan José Melero Gómez