Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class or Interface Missing: DaggerViewModelInjector #7

Open
Gkundu1 opened this issue Aug 30, 2018 · 4 comments
Open

Class or Interface Missing: DaggerViewModelInjector #7

Gkundu1 opened this issue Aug 30, 2018 · 4 comments

Comments

@Gkundu1
Copy link

Gkundu1 commented Aug 30, 2018

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.

@craicoverflow
Copy link
Contributor

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()

@rizmaulana
Copy link

No, it still not working

@miketrinh1995
Copy link

I do my way. It's work
apply plugin: 'kotlin-kapt'

kapt {
    generateStubs = true
}

@kharisazhar
Copy link

write
private val injector: ViewModelInjector = DaggerViewModelInjector , then build your project and click alt+enter or import DaggerViewModelInjector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants