Open nsmapp opened 3 weeks ago
Facing the same issue with the same versions in a multi-module project
I have the same issue
I have the same problem
As a workaround for anyone facing this (and a very ugly one), I have been copying/pasting the base abstract class and giving it a different name every time I need to use it until this gets resolved.
Not a good decision. As long as there is no annotation solution, you can use the standard Koin module:
val bindModule = module {
factory { FooA() } bind FooBase::class
factory { FooB() } bind FooBase::class
}
//@Factory()
class FooB: FooBase(){
val text = "text b"
}
//@Factory()
class FooB: FooBase(){
val text = "text b"
}
Describe the bug A multi-module project is built with an error when extending classes in different modules.
To Reproduce Module 1:
Module 2:
Module 3:
Module app:
Result. Project build with error
Caused by: com.android.tools.r8.internal.g: Type org.koin.ksp.generated.KoinDefOrgKoinSimpleBaseFooBase is defined multiple times: /media/nsm/4aeb5859-3b1a-4888-b1b7-6fb9ecd4a3b4/nsm/null2/koin-getting-started/android-annotations/module-a/build/.transforms/6c4b7a04527a57b0b19276e8afa44dda/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/koin/ksp/generated/KoinDefOrgKoinSimpleBaseFooBase.dex, /media/nsm/4aeb5859-3b1a-4888-b1b7-6fb9ecd4a3b4/nsm/null2/koin-getting-started/android-annotations/module-b/build/.transforms/f6d1a675067414cc1abdf61eac29739c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/koin/ksp/generated/KoinDefOrgKoinSimpleBaseFooBase.dex
Expected behavior Build the project without errors
Koin project used and used version (please complete the following information): koin = "4.0.0" koin-annotations = "2.0.0-Beta1" or "1.4.0"
Additional moduleDefinition With library version koin-annotations = "1.3.1" the project is built without errors