New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bound Multiple Times issue when using Hilt for UI Test, TestInstalln #3209
Comments
Hi @ankitkhare, Can you provide the full error message please? |
Hi @bcorso This the full error message
|
@ankitkhare thanks! Hmm, I see some of the class names don't quite align from your initial question. Is Otherwise, I'm not really sure why |
Hi @bcorso that was a typo I renamed it Have tried to create a small sample https://github.com/ankitkhare/Hilt_UItest_Demo. Please have a look. Thanks. |
Thanks for the sample project @ankitkhare! I was able to repro the issue in your project, however it may take me a few days before I can start debugging and fixing it. I'll update here once I know something. |
Hi @ankitkhare, Sorry for the delay! To fix this, you need to remove the - @Module(includes = [UrlModuleBindings::class, NetworkModule::class])
+ @Module
@InstallIn(SingletonComponent::class)
object AppModule {
// ...
} The issue is that while Hilt does uninstall the explicit In Hilt, you shouldn't ever need to use |
Thanks @bcorso. Working now. |
For me it still doesn't work and I am not even using Includes with Module annotation anywhere |
@sarimmehdi you will need to file a bug with more details. If your issue isn't related to using Edit: I see you filed #3692 already. I'll take a look. |
Hello, I've created a fake urlprovider binding and annotated with
@TestInstallIn
This is inside androidTest
my Prod UrlProvider looks like
This is Original Binding
when I'm running the UI test getting the error
**UrlProvider is bound multiple times:**
As per the documentation everything seems correct, can I please know what is the issue with this.
Have followed https://dagger.dev/hilt/testing.html
https://stackoverflow.com/questions/70844153/bound-multiple-times-issue-when-using-hilt-for-ui-test-testinstalln
The text was updated successfully, but these errors were encountered: