Open Morons opened 9 months ago
Seems like a classpath problem. Do you have multiple versions elsewhere?
Run ./gradlew dependencies
and check if are some library using koin (with different version of 3.5.1). If you found something you will need to update them.
I had the same problem, temporary fix
class XXXApplication : Application() {
override fun onCreate() {
super.onCreate()
startKoin {
androidLogger()
modules(
module {
single { this@XXXApplication } binds arrayOf(Context::class,Application::class)
}
)
}
}
}
why don't you use androidContext()
in your Koin config?
why don't you use
androidContext()
in your Koin config?
i will be crash, I tried that and was told that the module has not been provided for androidContext.
java.lang.NoSuchMethodError: No static method
keeps to be a setup/classpath problem here. Can you use directly implementation(project(
Same problem here. I'm using koin version 3.5.3
This not work:
startKoin {
androidLogger()
androidContext(this@MainApplication)
modules(MainModule.instance)
}
Using @hoangchungk53qx1's suggestion works:
startKoin {
androidLogger()
module {
single { this@MainApplication } binds arrayOf(Context::class, Application::class)
}
modules(MainModule.instance)
}
What is curious is that behind the scene, Koin is making the binds for you 🤔
What is curious is that behind the scene, Koin is making the binds for you 🤔
I think something went wrong when publishing the new version.
any help to create a sample app to reproduce this? 🙏
Gradle