I’m creating an android app and i have multiple repositories, each used in certain usecases classes. In my AppModule.kt file i provide all these constructors however i seem to have gotten errors about duplicate bindings and i’m not sure how to fix these. My code looks like this. `
@Provides
fun provideUseCases
}
The error i receive looks like enter code here
2
Answers
I fixed it by skipping all the specific collections and just inserting Firebase.firestore and differentiation in the repositories themselves
Well, basically hilt has no way to difference between all of the functions that provide the same type, so:
is impossible to differenciate for hilt when you try to inject a firebase collection somewhere, you can use the @Named annotation to avoid this error take a look at this for more info (step 5 and 6)