How can I tell which classes Proguard warns me about?

爷,独闯天下 提交于 2019-12-12 11:26: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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/38537095/how-can-i-tell-which-classes-proguard-warns-me-about

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!