Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

522
Vistas
how can i fix the installation of Koin in ktor/intellij

I'm trying to use install koin but it gives the following text when i hover over it.

Type mismatch. Required: Plugin<TypeVariable(P), TypeVariable(B), TypeVariable(F)> Found: Koin.Feature

the code is as in the following:

import io.ktor.server.application.*
import org.koin.ktor.ext.Koin

fun Application.configureKoin(){
install(Koin){
    
}
}
over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

Seems like you are trying to install a plugin, that's written for Ktor 1.*, in a Ktor server with version 2.*. To make it work you have to use Ktor server 1.*, e.g 1.6.7, or wait until plugin maintainers migrate to version 2.0.0. Here you can find a list of incompatible changes and a migration guide for Ktor 2.0.0.

over 4 years ago · Santiago Trujillo Denunciar

0

Had the same issue. Which version of the ktor plugin are you using? I was using 2.0.0 beta and changed to 1.6.4 and it works now. Can find it in the gradle.properties file.

over 4 years ago · Santiago Trujillo Denunciar

0

Until the Ktor 2.0 plugin for Koin is added, you can use the solution below, which is taken from here (credits to phucynwa). Also, you can track the Pull request here.

object KoinPlugin : ApplicationPlugin<Application, KoinApplication, Unit> {

   override val key: AttributeKey<Unit>
       get() = AttributeKey("Koin")

   override fun install(
       pipeline: Application,
       configure: KoinApplication.() -> Unit
   ) {
       val monitor = pipeline.environment.monitor
       val koinApplication = startKoin(appDeclaration = configure)
       monitor.raise(EventDefinition(), koinApplication)

       monitor.subscribe(ApplicationStopping) {
           monitor.raise(EventDefinition(), koinApplication)
           stopKoin()
           monitor.raise(EventDefinition(), koinApplication)
       }
   }
}

fun Application.installPlugins() {
   install(KoinPlugin)
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda