Andrey Larionov
05/22/2024, 9:05 PM2024-05-23 00:49:44.444 [main] DEBUG [Koin] - Started 29 definitions in 0.796209 ms
2024-05-23 00:49:44.444 [main] DEBUG [Koin] - Create eager instances ...
2024-05-23 00:49:44.444 [main] DEBUG [Koin] - Created eager instances in 0.11425 ms
2024-05-23 00:49:44.445 [main] DEBUG [Koin] - Create eager instances ...
2024-05-23 00:49:44.445 [main] DEBUG [Koin] - Created eager instances in 0.002666 ms
Exception in thread "main" java.lang.NoSuchMethodError: 'io.ktor.events.Events io.ktor.server.application.ApplicationEnvironment.getMonitor()'
at org.koin.ktor.plugin.KoinPluginKt.setupMonitoring(KoinPlugin.kt:54)
at org.koin.ktor.plugin.KoinPluginKt$Koin$2.invoke(KoinPlugin.kt:38)
at org.koin.ktor.plugin.KoinPluginKt$Koin$2.invoke(KoinPlugin.kt:35)
at io.ktor.server.application.CreatePluginUtilsKt.setupPlugin(CreatePluginUtils.kt:300)
at io.ktor.server.application.CreatePluginUtilsKt.createPluginInstance(CreatePluginUtils.kt:269)
at io.ktor.server.application.CreatePluginUtilsKt.access$createPluginInstance(CreatePluginUtils.kt:1)
at io.ktor.server.application.CreatePluginUtilsKt$createApplicationPlugin$2.install(CreatePluginUtils.kt:90)
at io.ktor.server.application.CreatePluginUtilsKt$createApplicationPlugin$2.install(CreatePluginUtils.kt:83)
when tried to add Koin to Ktor server
private fun connectServer() = embeddedServer(
factory = Netty,
port = 8080,
module = { setApplicationModule() } // configureKoin here
).start(wait = true)
internal fun Application.configureKoin() {
install(Koin) { // <--- Error here
slf4jLogger(level = Level.DEBUG)
modules(serverModules)
}
}
I use these versions
koin = "3.6.0-wasm-alpha2"
ktor = "3.0.0-wasm2"
ktor-plugin = "3.0.0-beta-1"
koin = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-ktor = { module = "io.insert-koin:koin-ktor", version.ref = "koin" }
koin-ktor-logger = { module = "io.insert-koin:koin-logger-slf4j", version.ref = "koin" }
Can you please tell me what did I wrong? ThanksPablichjenkov
05/22/2024, 10:03 PMAndrey Larionov
05/22/2024, 10:05 PMAndrey Larionov
05/22/2024, 10:07 PMRobert Jaros
05/23/2024, 4:45 AMAndrey Larionov
05/23/2024, 8:53 AMwasm
?
> Could not resolve all dependencies for configuration ':app_presentation:wasmJsCompileClasspath'.
> Could not find io.insert-koin:koin-compose:3.6.0-Beta4.
Andrey Larionov
05/23/2024, 9:16 AMkoin = "3.6.0-Beta4"
koin-compose = "1.2.0-Beta4"
koin = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-ktor = { module = "io.insert-koin:koin-ktor", version.ref = "koin" }
koin-ktor-logger = { module = "io.insert-koin:koin-logger-slf4j", version.ref = "koin" }
koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin-compose" }
koin-android = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koin" }
Changed koin-compose
version, but still getting an errorAndrey Larionov
05/24/2024, 11:19 AMAndrey Larionov
05/24/2024, 1:58 PMktor-server
deps:
ktor = "2.3.11"
ktor-plugin = "2.3.11"