Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

529
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda