gpt4 book ai didi

android - Proguard:忽略包不会阻止警告

转载 作者:行者123 更新时间:2023-11-30 01:15:53 25 4
gpt4 key购买 nike

为什么让 proguard 忽略一个包并不能阻止与该包相关的警告?

背景:

我正在尝试将混淆器应用于大型项目。不出所料,我有很多这样的警告:

Warning:net.fortuna.ical4j.model.CalendarFactory: can't find superclass or interface groovy.util.AbstractFactory
Warning:net.fortuna.ical4j.model.CalendarFactory: can't find superclass or interface groovy.lang.GroovyObject
Warning:net.fortuna.ical4j.model.ContentBuilder: can't find superclass or interface groovy.util.FactoryBuilderSupport
Warning:net.fortuna.ical4j.model.ParameterListFactory: can't find superclass or interface groovy.util.AbstractFactory
Warning:net.fortuna.ical4j.model.ParameterListFactory: can't find superclass or interface groovy.lang.GroovyObject
Warning:net.fortuna.ical4j.model.component.AbstractComponentFactory: can't find superclass or interface groovy.util.AbstractFactory
Warning:net.fortuna.ical4j.model.component.AbstractComponentFactory: can't find superclass or interface groovy.lang.GroovyObject
Warning:net.fortuna.ical4j.model.component.XComponentFactory: can't find superclass or interface groovy.util.AbstractFactory
Warning:net.fortuna.ical4j.model.component.XComponentFactory: can't find superclass or interface groovy.lang.GroovyObject
Warning:net.fortuna.ical4j.model.parameter.AbstractParameterFactory: can't find superclass or interface groovy.util.AbstractFactory
Warning:net.fortuna.ical4j.model.parameter.AbstractParameterFactory: can't find superclass or interface groovy.lang.GroovyObject
Warning:net.fortuna.ical4j.model.property.AbstractPropertyFactory: can't find superclass or interface groovy.util.AbstractFactory

我想我可以通过从混淆器中排除这些包来解决这个问题,直到我的应用程序在启用混淆器的情况下运行。然后,逐个包地工作,我可以弄清楚是应该忽略警告还是只排除必要的部分。

我用了this example如何排除包,添加

-keep class net.fortuna.ical4j.model.** { public protected private *;

到我的 proguard 规则文件。但是,我收到与以前相同的警告。我确实找到了 this这建议将 -keep-dontwarn 结合使用,但我不明白为什么让 proguard 忽略包并不能一起阻止警告。

最佳答案

保留一个类不会自动隐藏与该类相关的警告,因为它们可能指示配置问题或缺少输入。

隐藏特定包使用的警告

-dontwarn com.example.**

这只会隐藏警告,不会隐藏注释,可以这样隐藏:

-dontnote com.example.**

查看您的特定警告消息,您似乎缺少 ical4j 模型类使用和引用的 groovy 库。

关于android - Proguard:忽略包不会阻止警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37866138/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com