I have an issue with Anvil that drives me crazy. I...
# squarelibraries
e
I have an issue with Anvil that drives me crazy. I have two classes defined in the same library module
Copy code
@ContributesBinding(scope = Singleton::class)
class ConnectionStatusProviderImpl @Inject constructor(
    application: Application
) : ConnectionStatusProvider {
and
Copy code
@ContributesBinding(scope = Singleton::class)
class AndroidResourceUtil @Inject constructor(
    @AppContext context: Context
) : ResourceUtil {
which should add a binding to the ApplicationComponent (in the app module)
Copy code
@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? ``````
🦆 1
turns out the culprit was using
2.4.9-1-8
of the library instead of
2.4.9
(we already migrated to Kotlin 1.9.x)