I’ve tried using both Molecule and Koin for state management, but I’m running into class loader errors with both of them. Does anyone know how to fix this?
java.lang.ClassCastException: class androidx.compose.runtime.ComposerImpl cannot be cast to class androidx.compose.runtime.Composer (androidx.compose.runtime.ComposerImpl is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @5d06915d; androidx.compose.runtime.Composer is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4adf6740)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
at org.jetbrains.jewel.bridge.ToolWindowExtensionsKt.addComposeTab$lambda$0(ToolWindowExtensions.kt:26)
Here’s my configuration:
dependencies {
implementation("ai.koog:koog-agents:0.3.0"){
exclude(group = "org.jetbrains.compose")
exclude(group = "androidx.compose")
exclude(group = "androidx.compose.runtime")
exclude(group = "androidx.compose.ui")
exclude(group = "androidx.compose.foundation")
exclude(group = "androidx.compose.material")
}
testImplementation("junit:junit:4.13.2")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0")
implementation("app.cash.molecule:molecule-runtime:${molecule_version}"){
exclude(group = "org.jetbrains.compose.material")
}
intellijPlatform {
create("IC", "2025.2")
testFramework(TestFrameworkType.Platform)
bundledModule("intellij.platform.jewel.foundation")
bundledModule("intellij.platform.jewel.ui")
bundledModule("intellij.platform.jewel.ideLafBridge")
bundledModule("intellij.platform.jewel.markdown.core")
bundledModule("intellij.platform.jewel.markdown.ideLafBridgeStyling")
bundledModule("intellij.libraries.compose.foundation.desktop")
bundledModule("intellij.libraries.skiko")
}
}