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

Error during ViewModel multibinding #8

Open
sarry173 opened this issue Apr 22, 2020 · 1 comment
Open

Error during ViewModel multibinding #8

sarry173 opened this issue Apr 22, 2020 · 1 comment

Comments

@sarry173
Copy link

error: [Dagger/MissingBinding] java.util.Map<java.lang.Class<? extends androidx.lifecycle.ViewModel>,? extends javax.inject.Provider<androidx.lifecycle.ViewModel>> cannot be provided without an @Provides-annotated method.

@mickverm
Copy link

If you're using kotlin you have to put @JvmSuppressWildcards before Provider<ViewModel> in the constructor:

class ViewModelProviderFactory @Inject constructor(
    private val creators: Map<Class<out ViewModel>, @JvmSuppressWildcards Provider<ViewModel>>
) : ViewModelProvider.Factory {

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

2 participants