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.
François
03/01/2025, 8:44 AM
If it’s really a bug, I’m going to create an issue.
François
03/03/2025, 1:33 PM
Finally did it without using Annotation, I’m losing the KOIN_CONFIG_CHECK rule by mixing both approach.
d
Dusan Stefanovic
03/03/2025, 5:34 PM
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
François
03/03/2025, 6:06 PM
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()
}