I've created a fake urlprovider binding and annotated with TestInstallIN
@Module
@TestInstallIn(
components = [SingletonComponent::class],
replaces = [UrlModuleBindings::class]
)
abstract class FakeAppBindings {
@Binds
abstract fun bindsUrlProvider(urlProvider: FakeUrlProvider): UrlProvider
}
my Prod UrlProvider looks like
@Module
@InstallIn(SingletonComponent::class)
abstract class UrlModuleBindings {
@Binds
abstract fun bindsUrlProvider(urlProvider: DefaultUrlProvider): UrlProvider
}
when I'm running the UI test getting the error UrlProvider is bound multiple times:
As per the documentation everything seems correct, can I know what is the issue with this.
Thanks to Brad, the issue was with the AppModule, I was using Includes whereas hilt doesn't need Includes as it already has InstallIn annotation for this purpose. Once I remove it the UI test starts to work.
More details.
https://github.com/google/dagger/issues/3209
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With