How can I tell proguard to assume a package is not used?

久未见 提交于 2019-12-04 07:28:59

An alternative to specifying a filter on the outjars could be to specify a filter on the injars:

-injars in.jar(!unwanted/package/**)

This way, you won't unnecessarily drag in any classes that are referenced by this package, since the filtering is happening before any processing.

ProGuard will now warn about the missing classes, so you have to specify that it's ok:

-dontwarn unwanted.package.**

You should be careful with these options, since suppressing warnings does not necessarily make the problems go away. As pst wrote, you'll get NoClassDefFoundsErrors if you filter out classes that are actually required.

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