Proguard packaging breaks jar without changing any file inside jar
Java class file shrinker, optimizer, obfuscator, and preverifier
Brought to you by:
guardsquare
Proguard seams to break a given jar although the files themself are not changed.
Checkout the following git example:
https://github.com/ArlindNocaj/jogl_gradle
Using gradle proguard generated two jar files where the proguard output does not start anymore using java -jar.
The used proguard config is:
-dontwarn
-dontobfuscate
-dontshrink
-dontoptimize
-dontpreverify
I checked the jar files using pkgDiff to see the differences inside the jars. There are no differences regarding the files inside the jar.
Anyone has a hint on how to fix this issue?
Workaround:
Workaround:
Repackaging the proguard output jar actually makes the jar work again.
Any hints how to fix this issue within proguard?
Finally I found out that the difference between the two jars is only the missing directory entries in the proguard output jar.
Including the directories into that jar using the
-keepdirectoriesoption fixes this problem.Good to hear you found the cause. This is indeed a subtle difference in packaging, to make the jars as small as possible. It only matters very rarely; the option -keepdirectories is the correct solution.