I am currently wondering why I should include a network dependency that normally lives inside my :core module in my :app module. Dagger/Hilt is not capable of resolving my @Singleton OkHttp client which which is defined in :core inside a Hilt Module.
It looks like this:
// :core
@Module
@InstallIn(SingletonComponent::class)
object MyModule {
...
@Provides
@Singleton
fun provideOkHttpClient(): OkHttpClient {
return OkHttpClient.Builder().build()
}
}
// build.gradle(:core)
dependencies {
implementation platform(Libs.OkHttp.bom)
implementation Libs.OkHttp.lib
implementation Libs.OkHttp.logging
}
It works if you do
dependencies {
api platform(Libs.OkHttp.bom)
api Libs.OkHttp.lib
api Libs.OkHttp.logging
}