I'm in a multi-module, multi-platform project, mig...
# koin
j
I'm in a multi-module, multi-platform project, migrating to Koin using Koin Annotations. The issue I run into is that the DefaultModule is generated next to each module's generated implementation, and that default one is always
org.koin.ksp.generated.defaultModule
, causing collisions. How can I disable the default module generation and only use my own ones (with
@ComponentScan
)?
Error: Type org.koin.ksp.generated.DefaultKt$defaultModule$1$1 is defined multiple times
🦆 Classic rubber duck! I looked into the generated code already but now I finally noticed that the generated stuff is not the same! The default module was adding generated code that my modules was missing. Long investigation short: I had my
Module
class in a sub-package, and it only scans downwards (into deeper packages). I moved it one package up (in the root of my gradle module) and now it's putting all dependencies in the generated module and the
defaultModule
is gone 🎉
a
yes, first intent for `defaultModule`was to help catch definitions unrelated to any module. Perhaps we could disable it if with an option
the really good improvement should come from Gradle modules scan ... avoiding to have a Koin module in each module would be great
234 Views