Guardsquare / proguard

ProGuard, Java optimizer and obfuscator
https://www.guardsquare.com/en/products/proguard
GNU General Public License v2.0
2.69k stars 395 forks source link

Unexpected error while preverifying #55

Open lackoSK opened 4 years ago

lackoSK commented 4 years ago

Hello,

I am having issues with proguard.

[proguard] Unexpected error while performing partial evaluation: [proguard] Class = [org/mineacademy/chatcontrol/final/nul/ /f] [proguard] Method = [a()V] [proguard] Exception = [java.lang.IllegalArgumentException] (Can't find common super class of [org/mineacademy/chatcontrol/a] (with 3 known super classes) and [org/mineacademy/chatcontrol/api/event/PrePrivateMessageEvent] (with 1 known super classes)) [proguard] Unexpected error while preverifying: [proguard] Class = [org/mineacademy/chatcontrol/final/nul/ /f] [proguard] Method = [a()V] [proguard] Exception = [java.lang.IllegalArgumentException] (Can't find common super class of [org/mineacademy/chatcontrol/a] (with 3 known super classes) and [org/mineacademy/chatcontrol/api/event/PrePrivateMessageEvent] (with 1 known super classes)) [proguard] Error: Can't find common super class of [org/mineacademy/chatcontrol/a] (with 3 known super classes) and [org/mineacademy/chatcontrol/api/event/PrePrivateMessageEvent] (with 1 known super classes)

proguard.conf: https://pastebin.com/SwRUjKK7 pom.xml: https://pastebin.com/zSt0afSG

How do I fix this?

Thank you for you answer.

Sincerely, Ladislav

EricLafortune commented 4 years ago

You're specifying -dontwarn, which suppresses DexGuard's warnings that it doesn't have some superclasses of a class in org.mineacademy.chatcontrol. It needs them to properly process the application. You should add the library on which the chatcontrol library builds.

See ProGuard manual > Troubleshooting > Error: Can't find common super class of ... and ...

lackoSK commented 4 years ago

Hello,

Thank you for your quick answer. How do I add the library so it will not show up errors?

I'm using maven to import the library.

EDIT: If you look to my pom.xml .. How would I add all libraries I need to prevent from showing the errors?

Sincerely, Ladislav

EricLafortune commented 4 years ago

I'm not very familiar with the ProGuard Maven plugin. According to its documentation, it should add all dependencies automatically. It's possible that there is interference with the Shade plugin though, considering that it also changes packaging.

You can let ProGuard write out the full configuration with the Maven plugin setting <configuration><options><option>-printconfiguration config.pro</option></options></configuration>. The resulting file contains all ProGuard settings (also usable from the command line: bin/proguard @ config.pro). The file will list the input jars (your program), the library jars (like the Java runtime), and the output jar. That should hopefully give an indication as to which input is missing.

lackoSK commented 4 years ago

Hello,

Thank you for your answer.

I think they are being shaded properly. https://pastebin.com/UHTwqV8U

Sincerely, Ladislav

chenakam commented 2 years ago

-keepclassmembers, allowobfuscation class org.mineacademy.chatcontrol.** { *; }