Emanuel Moecklin
02/10/2024, 4:47 AM@ContributesBinding(scope = Singleton::class)
class ConnectionStatusProviderImpl @Inject constructor(
application: Application
) : ConnectionStatusProvider {
and
@ContributesBinding(scope = Singleton::class)
class AndroidResourceUtil @Inject constructor(
@AppContext context: Context
) : ResourceUtil {
which should add a binding to the ApplicationComponent (in the app module)
@Singleton
@MergeComponent(scope = Singleton::class)
interface ApplicationComponent {
This works as expected for ConnectionStatusProviderImpl
but not for AndroidResourceUtil
. I get the dreaded
> [Dagger/MissingBinding] xyz.ResourceUtil cannot be provided
If I copy the class into the main module, it works perfectly but obviously we don't want to move dependencies to the app module just to make it work with Anvil + Dagger. What am I overlooking?
``````Emanuel Moecklin
02/11/2024, 8:53 PM2.4.9-1-8
of the library instead of 2.4.9
(we already migrated to Kotlin 1.9.x)