gpt4 book ai didi

java - Android 和 Proguard 以及 jackrabbit-webdav : Proguard returned with error code 1. 请参阅控制台

转载 作者:行者123 更新时间:2023-12-02 03:01:14 26 4
gpt4 key购买 nike

我在 Android 应用程序中使用“jackrabbit-webdav-2.2.5-jar-with-dependency.jar”。我自己构建了它,只要我直接从 Eclipse 调试或运行该应用程序,一切都会正常。此外,当我将应用程序导出为没有 Proguard 的“签名应用程序包”以便将其安装在任何设备上时,一切正常。

但是当使用Proguard(java obfuscator)启动时出现问题。这是控制台的快照:

[2013-09-22 22:23:45 - Zarathustra] Proguard returned with error code 1. See console
[2013-09-22 22:23:45 - Zarathustra] Note: there were 1 duplicate class definitions.
[2013-09-22 22:23:45 - Zarathustra] Warning: org.apache.jackrabbit.commons.AbstractItem: can't find superclass or interface javax.jcr.Item
[2013-09-22 22:23:45 - Zarathustra] Warning: org.apache.jackrabbit.commons.AbstractNode: can't find superclass or interface javax.jcr.Node
[2013-09-22 22:23:45 - Zarathustra] Warning: org.apache.jackrabbit.commons.AbstractProperty: can't find superclass or interface javax.jcr.Item
[2013-09-22 22:23:45 - Zarathustra] Warning: org.apache.jackrabbit.commons.AbstractProperty: can't find superclass or interface javax.jcr.Property
.....
.....
[2013-09-22 22:23:45 - Zarathustra] Warning: org.slf4j.MarkerFactory: can't find referenced class org.slf4j.impl.StaticMarkerBinder
[2013-09-22 22:23:45 - Zarathustra] Warning: org.slf4j.MarkerFactory: can't find referenced class org.slf4j.impl.StaticMarkerBinder
[2013-09-22 22:23:45 - Zarathustra] Warning: there were 2333 unresolved references to classes or interfaces.
[2013-09-22 22:23:45 - Zarathustra] You may need to specify additional library jars (using '-libraryjars').
[2013-09-22 22:23:45 - Zarathustra] Warning: there were 40 unresolved references to program class members.
[2013-09-22 22:23:45 - Zarathustra] Your input classes appear to be inconsistent.
[2013-09-22 22:23:45 - Zarathustra] You may need to recompile them and try again.
[2013-09-22 22:23:45 - Zarathustra] Alternatively, you may have to specify the option
[2013-09-22 22:23:45 - Zarathustra] '-dontskipnonpubliclibraryclassmembers'.
[2013-09-22 22:23:45 - Zarathustra] java.io.IOException: Please correct the above warnings first.
[2013-09-22 22:23:45 - Zarathustra] at proguard.Initializer.execute(Initializer.java:321)
[2013-09-22 22:23:45 - Zarathustra] at proguard.ProGuard.initialize(ProGuard.java:212)
[2013-09-22 22:23:45 - Zarathustra] at proguard.ProGuard.execute(ProGuard.java:87)
[2013-09-22 22:23:45 - Zarathustra] at proguard.ProGuard.main(ProGuard.java:493)

我尝试了几个混淆器标签,但没有帮助。看来 proguard 需要在类路径中显式地显示所有依赖项。也许这个问题必须用maven来解决? (我不是使用 Maven 的专家 - 我尝试了几种方法,但它们没有帮助)。

有人也有这样的问题吗?有什么建议或提示如何解决它吗?

提前致谢!约翰

最佳答案

ProGuard 确实需要所有依赖项来进行静态分析。然而,丢失的类可能永远不会被使用,所以你可以告诉 ProGuard 忽略它们:

-dontwarn javax.jcr.**
-dontwarn org.slf4j.**

请参阅 ProGuard 手册 > 故障排除 > Warning: can't find referenced class

关于java - Android 和 Proguard 以及 jackrabbit-webdav : Proguard returned with error code 1. 请参阅控制台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18948480/

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