Hi! I'm trying to add `jvm("desktop")` target to m...
# koin
h
Hi! I'm trying to add
jvm("desktop")
target to my Compose Multiplatform app. I use
KoinApplication
in my
main.kt
for desktop, but when I try to run it I get this exception:
Copy code
Exception in thread "main" java.lang.NoClassDefFoundError: org/koin/core/error/KoinAppAlreadyStartedException
	at com.husqvarna.slc.ComposableSingletons$MainKt$lambda-2$1.invoke(main.kt:19)
	at com.husqvarna.slc.ComposableSingletons$MainKt$lambda-2$1.invoke(main.kt:18)
I haven't been able to find any solutions online. Any suggestions?
👀 1
This is my main function for desktop:
Copy code
fun main() {
    application(exitProcessOnExit = true) {
        KoinApplication({
            modules(<all my modules>)
        }) {

            Window(
                onCloseRequest = ::exitApplication,
                title = "My App",
            ) {
                App()
            }
        }
    }
}
a
Hey Erik, seems that you trigger KoinAppAlreadyStartedException even if you don't have it in your classpath 🤔 What version do you use?
h
Copy code
4.1.0-Beta5
a
do you run
startKoin
before or you use only KoinApplication?
h
No
I can get it to work by calling startKoin instead of using the above.
a
ok, I'll check what's going on with this KoinApplication starter function
From KoinApplication you shouldn't call any startKoin before. It's starting the default context on its own
h
I know. That's what I looked at first. When I tried KoinApplication we weren't calling startKoin anywhere
👍 1