Search code examples
androiddagger-2dagger-hilt

"Cannot resolve method" @AuthInterceptorOkHttpClient


I am trying to integrate dagger-hilt on my project on android. I have implemented the libraries and steps in the link below. However, I cannot access the @AuthInterceptorOkHttpClient annotation. I get the error "Cannot resolve method". For this I need to add another library. Can experienced friends help?

https://developer.android.com/training/dependency-injection/hilt-android?hl=ja_jp


Solution

  • AuthInterceptorOkHttpClient is custome interface.

    @Qualifier
    @Retention(AnnotationRetention.BINARY)
    annotation class AuthInterceptorOkHttpClient
    

    They give an example in cases where you need Hilt to provide different implementations of the same type as dependencies.