Hi folks! I've an app running fine in IntelliJ but...
# compose-desktop
g
Hi folks! I've an app running fine in IntelliJ but generating a weird ClassCastException when I package the app (
./gradlew package
). I'm using a MAC M1.
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: class foo.bar.MyClass cannot be cast to class ....
Copy code
interface Animal { fun foo() }
interface Mammal : Animal
class Tiger : Mammal { ... }
It crashes when I call
foo()
on my Tiger instance. If I check with
is
, for some reasons
Tiger is Animal
on IDE and
Tiger is NOT Animal
once the app is packaged. (And Tiger is Mammal in both usage 🤷 ) Any idea what's going on?
I'm using Jdk 17.0.1 from Zulu in both cases.
o
Likely you have runtime classpath conflict so your class can be loaded from more than one JAR. Usually best way is to report at https://github.com/JetBrains/compose-jb/issues with full reproducer
g
Thanks! Is there a gradle command to check the classpath declarations or something that I should know/test before?