Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I tell which classes Proguard warns me about?

I am trying to release my app and ProGuard is causing all sorts of errors with my server code so I went into the gradle console and see this:

Note: there were 2 references to unknown classes.
  You should check your configuration for typos.
  (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 26 unkept descriptor classes in kept class members.
  You should consider explicitly keeping the mentioned classes
  (using '-keep').
  (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 22 unresolved dynamic references to classes or interfaces.
  You should check if you need to specify additional program jars.
  (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 15 accesses to class members by means of introspection.
  You should consider explicitly keeping the mentioned class members
  (using '-keep' or '-keepclassmembers').
  (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)

That's all fine and dandy, but how the heck do I know which specific references ProGuard is talking about? Surely they don't expect me to find/remember these references independently?

like image 938
Blaasd Avatar asked Jul 23 '16 00:07

Blaasd


Video Answer


2 Answers

In your module specific build folder, usage.txt file gets created.

build/outputs/mapping/release/usage.txt

This file contains what are all the methods removed and what are the classes effected. Make sure that any of the classes from your own project which matters are not removed.

like image 147
Ramesh Avatar answered Sep 29 '22 02:09

Ramesh


you need to add the verbose switch into the ProGuard configuration file:

-verbose

while the ProGuard Manual explains these notices - and how to fix them.

like image 30
Martin Zeitler Avatar answered Sep 29 '22 02:09

Martin Zeitler