Hello :waving-from-afar-left: I've created a comp...
# compose-desktop
j
Hello waving from afar left I've created a compose Multiplatform project that runs well in Android and iOS. However, when I execute
./gradlew runDistributable
for the desktop version, I'm getting the following error:
Copy code
Exception in thread "main" java.lang.NoSuchMethodError: 'void androidx.collection.LongSparseArray.<init>(int, int, kotlin.jvm.internal.DefaultConstructorMarker)'
        at androidx.compose.ui.input.pointer.PointerInputChangeEventProducer.<init>(PointerInputEventProcessor.kt:158)
        at androidx.compose.ui.input.pointer.PointerInputEventProcessor.<init>(PointerInputEventProcessor.kt:45)
        at androidx.compose.ui.node.RootNodeOwner.<init>(RootNodeOwner.skiko.kt:139)

...
Creating the Jar file works fine, but the native distributable has this crash as soon as the app is opened. Does anyone know what could be happening? blob thinking upside down
m
It looks like LongSparseArray is an Android-only class. That it compiled for desktop/JVM might be a bug. Compose / Material ui functions in the androidx package are generally available as part of compose multiplatform, but any other Android/Androidx package class is generally not available.
Are you using LongSparseArray yourself?
j
Hi @Mike Dawson ! Not really, that's why's it's surprising for me. According to the stacktrace, the problem is in the Compose initialization, at some point, is calls the
androidx.compose.ui.input.pointer.PointerInputChangeEventProducer
constructor and inside there's a class attribute of type
LongSparseArray
which is initialized by default
I just updated to 1.6.0-rc01 and now I'm getting another error lol
NoClassDefFoundError: java/lang/management/ManagementFactory
But it's because the library of Firebase (google) JDK version, it's invoking that class, I'll reach out to them