Hello again, I’m following this <guide>. This is n...
# koin
f
Hello again, I’m following this guide. This is not working, the generated module is still empty, if I’m using expect/actual. You can find the source code here.
If it’s really a bug, I’m going to create an issue.
Finally did it without using Annotation, I’m losing the KOIN_CONFIG_CHECK rule by mixing both approach.
d
I think that you can fix KOIN_CONFIG_CHECK by tagging dependencies provided with DSL with @Provided annotation, basically just tag all dependencies which are provided outside annotations with @Provided
f
Thanks, didn’t see the
@Provided
, it fixes this weird behavior of my module declaration.
Copy code
@Module
@ComponentScan("fr.frankois944.kmpviewmodel.database.room")
public class DatabaseFactoryModule {
    @Factory
    internal fun dbFactory(): DBFactory = DBFactory()

    @Single
    internal fun database(
        @Provided // if not set, KOIN_CONFIG_CHECK trigger an error
        factory: DBFactory,
    ): AppDatabase = factory.createRoomDatabase()
}
blob no problem 1