InsertKoinIO / koin

Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform

Home Page:https://insert-koin.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

koin.loadModules wrong api signature. (3.5.6)

johanno opened this issue · comments

Describe the bug
Using in our Test environment:

 val koin: Koin = application.getKoin()
 koin.loadModules(listOf(testModule))

I get the following error on runtime:

'void org.koin.core.Koin.loadModules$default(org.koin.core.Koin, java.util.List, boolean, int, java.lang.Object)'
java.lang.NoSuchMethodError: 'void org.koin.core.Koin.loadModules$default(org.koin.core.Koin, java.util.List, boolean, int, java.lang.Object)'

To Reproduce
Steps to reproduce the behavior:

  1. Android Project
  2. run :
 val koin: Koin = application.getKoin()
 koin.loadModules(listOf(testModule))
  1. See error

Expected behavior
No error

Koin module and version:
koin-core:3.5.6

Snippet or Sample project to help reproduce

 val koin: Koin = application.getKoin()
 koin.loadModules(listOf(testModule))

where application is an Android Application

I assume it is the wrong api in:

public static synthetic fun loadModules$default (Lorg/koin/core/Koin;Ljava/util/List;ZZILjava/lang/Object;)V

Causing the issue since the actual function signature is not:
public static synthetic fun loadModules$default (Lorg/koin/core/Koin;Ljava/util/List;ZZILjava/lang/Object;)V
but rather Koin, List, Boolean, Boolean.

It should help with function overload and other signatures. Can you reproduce it?

I found the Issue. It was an exclusion in a transitive dependency of another dependency.....

basically commenting out:
// exclude("io.insert-koin", "koin-core")

fixed it.

What probably was happening was that it was a different version of koin for compile time than at run time or sth. weird like that.