segunfamisa
03/13/2024, 7:45 PMmodule A:
interface A
module B:
interface B
@Single(binds = [B])
internal class BImpl : B
@Module
@ComponentScan
class KoinModuleB
module C:
interface C
@Factory(binds = [C])
internal interface CImpl(val b: B, val a: A) : C
@Module
@ComponentScan
class KoinModuleC
app module:
class AImpl : A
@Module(includes = [KoinModuleB, KoinModuleC]
AppModule {
fun provideA(impl: A): A
}
The generated code properly registered the dependencies.
Unfortunately however, compilation fails in module C with a
Missing Definition type '<package a>.A' for '<package c>.C'. Fix your configuration to define type 'A'.
I think somehow, it tries to fulfill the dependencies in Gradle module C while I have defined the implementation in the app module.
Is there a way to go around this?segunfamisa
03/13/2024, 7:57 PMclass AImpl
to gradle module A, and created a koin module there, everything worked fine 🤔segunfamisa
03/13/2024, 7:59 PMsegunfamisa
03/14/2024, 12:05 AMPedro Alberto
03/14/2024, 2:21 PMsegunfamisa
03/14/2024, 2:37 PM