Can't find super class

[proguard] Unexpected error while performing partial evaluation: Class = [org/springframework/boot/loader/Launcher] Method = [createArchive()Lorg/springframework/boot/loader/archive/Archive;] Exception = [proguard.evaluation.IncompleteClassHierarchyException] (Can’t find common super class of [org.springframework.boot.loader.archive.JarFileArchive] (with 1 known super classes: org.springframework.boot.loader.archive.JarFileArchive) and [org.springframework.boot.loader.archive.ExplodedArchive] (with 1 known super classes: org.springframework.boot.loader.archive.ExplodedArchive))Unexpected error while preverifying: Class = [org/springframework/boot/loader/Launcher] Method = [createArchive()Lorg/springframework/boot/loader/archive/Archive;] Exception = [proguard.evaluation.IncompleteClassHierarchyException] (Can’t find common super class of [org.springframework.boot.loader.archive.JarFileArchive] (with 1 known super classes: org.springframework.boot.loader.archive.JarFileArchive) and [org.springframework.boot.loader.archive.ExplodedArchive] (with 1 known super classes: org.springframework.boot.loader.archive.ExplodedArchive))

I am unable to resolve this issue even after using
-keep class org.springframework.** { *; }

Hi @dhruv989,

Welcome to the Guardsquare community! Can you share some more information about your project? (proguard version, gradle files, proguard configuration, …)

Am I correct that this is a SpringBoot project?

Here is an example of to setup a Gradle Spring Boot project with ProGuard:

It might serve a helpful resource for you as you setup your project.

Kind Regards,
Jack

1 Like

Hello Jack , This is a springboot project and i am using maven to build it.

currently i see this issue even after using -dontoptimize and -dontshrink.
Exception in thread “main” java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/spring-boot-2.5.8.jar
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:120)
at org.springframework.boot.loader.archive.JarFileArchive$NestedArchiveIterator.adapt(JarFileArchive.java:274)
at org.springframework.boot.loader.archive.JarFileArchive$NestedArchiveIterator.adapt(JarFileArchive.java:265)
at org.springframework.boot.loader.archive.JarFileArchive$AbstractIterator.next(JarFileArchive.java:226)
at org.springframework.boot.loader.ExecutableArchiveLauncher.createClassLoader(ExecutableArchiveLauncher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:55)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: java.io.IOException: Unable to open nested jar file ‘BOOT-INF/lib/spring-boot-2.5.8.jar’
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:306)
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:292)
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:116)
… 6 more
Caused by: java.lang.IllegalStateException: Unable to open nested entry ‘BOOT-INF/lib/spring-boot-2.5.8.jar’. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file
at org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:332)
at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:314)
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:303)
… 8 more