简体   繁体   中英

Android and Proguard with jackrabbit-webdav: Proguard returned with error code 1. See console

I am using „jackrabbit-webdav-2.2.5-jar-with-dependencies.jar“ in an app for android. I have built it myself and everything works fine as long as I debug or run the app directly from eclipse. Also when I export the app as a „signed application package“ without Proguard in order to install it on any device, everthing works fine.

But when using Proguard (java obfuscator) start the problems. Here is a snapshot from the console:

[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)

I tried several proguard tags but it did not help. It seems that proguard needs all dependencies explicitly in the classpath. Maybe the problem has to be solved with maven? (I am no expert using maven – I tried several things, but they did not help).

Does anybody have also such a problem? Any suggestion or tip how to solve it?

Thanks in advance! John

ProGuard indeed needs all dependencies for its static analysis. However, the missing classes presumably are never used, so you can tell ProGuard to ignore them:

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

See the ProGuard manual > Troubleshooting > Warning: can't find referenced class

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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