繁体   English   中英

我如何知道 Proguard 警告我哪些类?

[英]How can I tell which classes Proguard warns me about?

我正在尝试发布我的应用程序,而 ProGuard 导致我的服务器代码出现各种错误,所以我进入了 gradle 控制台并看到了这个:

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)

这一切都很好,但我怎么知道 ProGuard 正在谈论哪些具体的引用呢? 他们肯定不希望我独立地找到/记住这些参考文献吗?

在您的模块特定构建文件夹中,将创建 usage.txt 文件。

build/outputs/mapping/release/usage.txt

该文件包含删除的所有方法以及受影响的类。 确保您自己的项目中任何重要的类都没有被删除。

您需要将详细开关添加到 ProGuard 配置文件中:

-verbose

ProGuard 手册解释了这些注意事项 - 以及如何修复它们。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM