-
-
Notifications
You must be signed in to change notification settings - Fork 771
Closed
Labels
Description
Describe the bug
If a library is compiled using Koin 3.2, and an app using Koin 3.5 tries to use that library, a runtime exception can occur.
Koin 3.5 appears to be source-compatible with 3.3, but is not binary-compatible.
To Reproduce
- Declare a library with a dependency on Koin 3.2.4
- Define an entrypoint which uses the koinApplication { } API as instructed in insert-koin.io's "Context Isolation" documentation
- Define an app with a dependency on both the test library and Koin 3.5.6 (using BOM)
- Invoke the library's entrypoint in an app
An exception similar to the following will be produced:
No static method koinApplication(Lkotlin/jvm/functions/Function1;)Lorg/koin/core/KoinApplication; in class Lorg/koin/dsl/KoinApplicationKt; or its super classes (declaration of 'org.koin.dsl.KoinApplicationKt' appears in […])
Expected behavior
Maven dependency resolution will select 3.5.6 over 3.2.4 because they are theoretically semver-compatible and 3.5.6 is higher.
Library will continue to function as expected, with isolated context.
Snippet or Sample project to help reproduce
This also happened at here #1829.