smassive
02/05/2019, 1:56 PMval appModule = module {
single { get<Context>() as InitApp }
}
And then a dependency that requires the context was satisfied like this:
single { DependencyContext(get<Context>()) }
single { AnotherDependencyContext(get()) } // get() refers to Context
I don't know if it's important but in some places context was satisfied with casting and in another places without casting.
The problem was that Espresso tests were failing because AnotherDependencyContext
could not be satisfied.
The solution is change every get<Context>()
and get()
(referring to Context) by androidContext()
and stop providing Context through appModule
.
Do you know why?