The situation is as follows.
I have the AppModule
in it I register the MainModule
in it I retransfer the PartnersFragmentSubcomponent
I register the PartnersModule
.
When compile gives this error:
error: [Dagger/MissingBinding] [dagger.android.AndroidInjector.inject(T)] br.com.psicoativa.psicoapp.presentation.partners.list.PartnersFragment cannot be provided without an @Inject constructor or an @Provides-annotated method. This type supports members injection but cannot be implicitly provided.
public abstract interface PsicoComponent extends dagger.android.AndroidInjector<br.com.psicoativa.psicoapp.presentation.app.PsicoApp> {
^
br.com.psicoativa.psicoapp.presentation.partners.list.PartnersFragment is injected at
br.com.psicoativa.psicoapp.presentation.main.MainActivity.partnerFrag
br.com.psicoativa.psicoapp.presentation.main.MainActivity is injected at
dagger.android.AndroidInjector.inject(T)
component path: br.com.psicoativa.psicoapp.presentation.app.di.PsicoComponent ? br.com.psicoativa.psicoapp.presentation.main.di.MainModule_ContributeMainActivity.MainActivitySubcomponent
If I go in PartnersFragment
and write down the constructor with @Inject
, compiling it will display this error:
error: [Dagger/MissingBinding] [dagger.android.AndroidInjector.inject(T)] br.com.psicoativa.psicoapp.presentation.partners.list.contract.PartnersPresenter cannot be provided without an @Provides-annotated method.
public abstract interface PsicoComponent extends dagger.android.AndroidInjector<br.com.psicoativa.psicoapp.presentation.app.PsicoApp> {
^
br.com.psicoativa.psicoapp.presentation.partners.list.contract.PartnersPresenter is injected at
br.com.psicoativa.psicoapp.presentation.partners.list.PartnersFragment.setPresenter(presenter)
br.com.psicoativa.psicoapp.presentation.partners.list.PartnersFragment is injected at
br.com.psicoativa.psicoapp.presentation.main.MainActivity.partnerFrag
br.com.psicoativa.psicoapp.presentation.main.MainActivity is injected at
dagger.android.AndroidInjector.inject(T)
component path: br.com.psicoativa.psicoapp.presentation.app.di.PsicoComponent ? br.com.psicoativa.psicoapp.presentation.main.di.MainModule_ContributeMainActivity.MainActivitySubcomponent
Only **PartnersPresenter**
is connected to PartnersModule
:
@Module
abstract class PartnersModule {
@ContributesAndroidInjector
abstract fun contributePartnersFragment(): PartnersFragment
@Binds
abstract fun bindsPartnersPresenter(partnersPresenterImpl: PartnersPresenterImpl): PartnersPresenter
}
What am I doing wrong and am not realizing ??