You haven't bound Application
, you have only bound Context
, but somewhere else in your graph, you have some type that depends on Application
. Downstream dependencies which need Application
will attempt to implicitly bind it because Dagger cannot know that an object which requires Application
can be satisfied by @ForApplication Context
. Since Application
does not have an @Inject constructor nor @Inject fields, Dagger will fail.
You can fix your example by simply adding
@Provides @Singleton Application provideApplicationContext() {
return application;
}
in org.kamol.nefete.AndroidModule
As an aside, I recommend against binding Context
as it is too abstract a supertype and too easy to confuse with Activity
Context
s, even if you are binding with a @Qualifier
annotation, such as @ForApplication Context
. I would recommend instead binding Application
and having things depend on the more concrete type.