In my application I have a class hierarchy similar to the following one
public sealed interface Animal permits Mammal, Fish {}
public sealed interface Mammal permits Cat, Dog{}
public final class Fish implements Animal {}
public final class Cat implements Mammal {}
public final class Dog implements Mammal {}
class Main{
public static void main(String[] args){
new Dog();
new Cat();
new Fish();
}
}
When obfuscating with proguard, it changes the permitted subclasses of the Animal class to [...] Animal permits Fish. I'm suspecting because the Mammal class is not used in my application directly. However, when I try to run the obfuscated application, I get the following error
java.lang.IncompatibleClassChangeError: class fj cannot extend sealed interface ff (java.lang.ClassLoader./.defineClass1./.-2)
Here, fj = Mammal and ff = Animal. So java cannot load the Mammal class because it extends the Animal class and is no longer part of the permitted subclasses.
I'm suspecting that there is a bug in proguard that shrinks the application too much so that it can no longer be run.
In my application I have a class hierarchy similar to the following one
When obfuscating with proguard, it changes the permitted subclasses of the
Animalclass to[...] Animal permits Fish. I'm suspecting because theMammalclass is not used in my application directly. However, when I try to run the obfuscated application, I get the following errorHere,
fj = Mammalandff = Animal. So java cannot load theMammalclass because it extends theAnimalclass and is no longer part of the permitted subclasses.I'm suspecting that there is a bug in proguard that shrinks the application too much so that it can no longer be run.