koin-annotations icon indicating copy to clipboard operation
koin-annotations copied to clipboard

KMP Multi-Module Project Breaks when Extending Base Class Multiple times in Multiple Module - 1.4.0-RC4

Open Deorigami opened this issue 1 year ago • 1 comments

I have MultiModule KMP Project So i have BaseViewModel class in app_core module then i implement app_core module in every feature_module, then i extend BaseViewModel class on every ViewModel i have

But now i got this error when running the project:

Type org.koin.ksp.generated.KoinDefAppEyedeaCoreBaseBaseScreenModel is defined multiple times:

on this version everything works fine

koin = "4.0.0-RC1" koin-annotations = "1.4.0-RC3" koin-compose = "4.0.0-RC1"

then i upgrade the deps into this version and got this compile error

koin = "4.0.0-RC2" koin-annotations = "1.4.0-RC4" koin-compose = "4.0.0-RC2"

Deorigami avatar Sep 08 '24 00:09 Deorigami

For now you can't use Koin 4.0.0 and Koin Annotations 1.4. last is still in 1.9.X

arnaudgiuliani avatar Sep 17 '24 07:09 arnaudgiuliani

目前您不能使用 Koin 4.0.0 和 Koin Annotations 1.4。最后仍然是 1.9.X

The same problem, any solution to solve it?

darriousliu avatar Oct 28 '24 12:10 darriousliu

Would it be possible to provide a KOIN_GENERATE_META parameter to avoid generating the KoinMeta-xxxxxxx.kt file, which seem to do nothing

darriousliu avatar Oct 28 '24 12:10 darriousliu

any update or work around for this ?

Deorigami avatar Nov 19 '24 01:11 Deorigami

latest 4.0.0 version still have same issue

antanas-radzevicius-tg avatar Dec 07 '24 14:12 antanas-radzevicius-tg

Got the same problem on Android with the latest versions (koin 4.1.0-Beta3 and koin-annotations 2.0.0-Beta3), as well as older versions.

eschaumloeffel avatar Jan 06 '25 10:01 eschaumloeffel

Same issue here. We use Koin just like described there: https://insert-koin.io/docs/reference/koin-annotations/definitions/#qualifier-with-named

A plain Kotlin interface with 2 classes inheriting from it. The interface and the classes are each located in different modules. As soon as @ Single (and @ Named) is annotated on the 2nd class, Koin immediately throws this error message.

PhilTdr avatar Jan 16 '25 07:01 PhilTdr

can you precise again your case?

arnaudgiuliani avatar Jan 16 '25 16:01 arnaudgiuliani

@arnaudgiuliani please review my PR #206 and the associated issue #207, which proposes a solution to this problem. The PR will solve the problem when KOIN_CONFIG_CHECK parameter is set to false (the default setting).

Sepehr1812 avatar Jan 19 '25 08:01 Sepehr1812

Yep, good catch. Let me check 👍

arnaudgiuliani avatar Jan 20 '25 17:01 arnaudgiuliani

PR merged 👍

arnaudgiuliani avatar Jan 20 '25 18:01 arnaudgiuliani