bk9735732777
07/31/2024, 3:58 PMe: [ksp] --> Missing Definition type 'com.hero.domain.useCases.SuperheroUseCase' for 'com.hero.viewmodels.vms.SuperheroListingViewmodel'. Fix your configuration to define type 'SuperheroUseCase'.
I have added everything correctly i only added @KoinViewModel and its failing
@KoinViewModel
class SuperheroListingViewmodel(
private val superheroUseCase: SuperheroUseCase
) : ViewModel()
@Module
@ComponentScan("com.hero.viewmodels")
class ViewmodelModule
val viewmodelModule = module {
includes(
listOf(
ViewmodelModule().module
)
)
// viewModelOf(::SuperheroListingViewmodel)
viewModelOf(::SuperheroDetailsViewmodel)
viewModelOf(::ChatViewModel)
}
Usecase
@Single
class SuperheroUseCase(
private val superheroRepository: SuperheroRepository
)
@Module
@ComponentScan("com.hero.domain")
class DomainModule
val domainModule = module {
includes(
listOf(
DomainModule().module
)
)
}
Any thing incorrect here ?Pablichjenkov
07/31/2024, 4:59 PMPablichjenkov
07/31/2024, 5:02 PMPedro Francisco de Sousa Neto
07/31/2024, 7:10 PM@Single
class SuperheroUseCase(
private val superheroRepository: SuperheroRepository
)
TO
@Single
class SuperheroUseCaseImpl(
private val superheroRepository: SuperheroRepository
): SuperheroUseCase
interface SuperheroUseCase
As @Pablichjenkov suggested, it will fix.bk9735732777
08/01/2024, 1:29 AMbk9735732777
08/01/2024, 1:30 AMbk9735732777
08/01/2024, 1:31 AMPedro Francisco de Sousa Neto
08/01/2024, 1:15 PMViewModelModule().module
?
I'm asking this to confirm that your KSP + Koin Annotations is configured right. Because if don't, it will not generate the expected class and give this error that you mentioned initially.bk9735732777
08/04/2024, 9:51 AMbk9735732777
08/04/2024, 9:51 AM