How can I tell which classes Proguard warns me abo

2019-06-21 09:53发布

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?

2条回答
beautiful°
2楼-- · 2019-06-21 10:17

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.

查看更多
闹够了就滚
3楼-- · 2019-06-21 10:18

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.

查看更多
登录 后发表回答