MVVMPosts
MVVMPosts copied to clipboard
Class or Interface Missing: DaggerViewModelInjector
Reporting one issue while following and implementing your code. Under package net.gahfy.mvvmposts.base Class BaseViewModel Unresolved Item DaggerViewModelInjector In the code mentioned as net.gahfy.mvvmposts.injection.component.DaggerViewModelInjector So please let us know if its class or interface.
Hi @Gkundu1
This class will be generated when you build your application.
So add the code in BaseViewModel.kt
like below. Android Studio will not recognise it immediately but once you run your application it should pick it up.
private val injector: ViewModelInjector = DaggerViewModelInjector
.builder()
.networkModule(NetworkModule)
.build()
No, it still not working
I do my way. It's work apply plugin: 'kotlin-kapt'
kapt {
generateStubs = true
}
write private val injector: ViewModelInjector = DaggerViewModelInjector , then build your project and click alt+enter or import DaggerViewModelInjector