-
Notifications
You must be signed in to change notification settings - Fork 55
@ContributesAndroidInjector, custom scope and @AssistedInject issue #127
Comments
I'm guessing you're using the multibinds ViewModelFactory pattern, where you've got an omni factory made at the Instead of using the multibind factory stuff, just directly get the factory of the vm you need and use that. |
Also, this issue should be closed, as it's not really related to AssistedInject at all, just a bog-standard Dagger question. |
Hello. |
Yes, but you wanted to use @AssistedInject right? So I don't see why that's relevant. |
That's exactly what my question was about. I wondered if the code working fine without assisted inject library should still work if I use it and amend a code accordingly. As far as I see there is not much changed in a code. But something breaks and it stops to compile. |
Hello.
I want to use lifecycle-viewmodel-savedstate in my project, so I came across AssistedInject and decided to use it.
But regardless of all my efforts to mix it with my current project stucture I get compiler errors all the time.
Everything compiles and works fine if I don't use @AssistedInject, @AssistedInject.Factory and ViewModelAssistedFactoriesModule.
But as a result I obviously can't use "@assisted SavedStateHandle savedStateHandle" which was the main goal of all this.
So is it possible to use @AssistedInject with all this @ContributesAndroidInjector and @AuthScope stuff?
Here is my simple configuration:
AppModule provides global @singleton dependencies like, for example, Context and so on.
In AuthActivity I have this bit of code:
But compiler complains:
com.alidi.base.models.auth.LoginValidator cannot be provided without an @Provides-annotated method.
javax.inject.Provider<com.alidi.base.models.auth.LoginValidator> is injected at
com.alidi.base.ui.auth.AuthActivityVM_AssistedFactory(…, loginValidator, …)
The text was updated successfully, but these errors were encountered: