You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A multi-module project run with an error when using classes with the same name.
To Reproduce
Module 1
package testproject.test1
@Single
class Test{}
@Single
class Test1(val test: Test)
Module 2
package testproject.test2
@Single
class Test{}
@Single
class Test2(val test: Test)
Module Main
package testproject
@ComponentScan("testproject")
class AppModule
class MainActivity : AppCompatActivity() {
private val test1: Test1 by get()
private val test2: Test2 by get()
...
}
Result. Project run with error
Caused by: org.koin.core.error.NoDefinitionFoundException: No definition found for type 'testproject.test2.Test'
This happens because the define<*> functions are added to the generated AppModule class without regard to the package name.
Describe the bug
A multi-module project run with an error when using classes with the same name.
To Reproduce
Module 1
Module 2
Module Main
Result. Project run with error
Caused by: org.koin.core.error.NoDefinitionFoundException: No definition found for type 'testproject.test2.Test'
This happens because the define<*> functions are added to the generated AppModule class without regard to the package name.
Since there are two defineTest() functions, only the first one resolves.
Expected behavior
Run the project without errors
Koin project used and used version:
koin = "4.0.1-RC1"
koin-annotations = "2.0.0-Beta2" or "1.4.0"
The text was updated successfully, but these errors were encountered: