How to inspect proguard process, so I know what ta

2019-05-18 00:54发布

问题:

My release build is stuck on

:android:transformClassesAndResourcesWithProguardForRelease

for 10 minutes. Gradle console does not print anything. How do I make it print what proguard is doing, so I know where the problem could be?

回答1:

You need to add the following to your proguard configuration file:

-verbose

Additionally, you need to enable info logging for your gradle build via

gradle -i <target>

where target is the actual task your are running (most likely assembleRelease).

Then you will see more output and what ProGuard is currently doing. Based on experience, the optimization step can take a long time, so you might want to reduce the number of optimization passes using:

-optimizationpasses 3