const val FORBIDDEN_INTERCEPTOR = "forbiddenInterceptor"
const val USER_AGENT_INTERCEPTOR = "userAgentInterceptor"
single<Interceptor>(named(USER_AGENT_INTERCEPTOR)) {
get<Interceptor>(named(FORBIDDEN_INTERCEPTOR)) // simulate the need to get the dep
UserAgentInterceptor()
}
singleOf(::UnauthorizedInterceptor) {
named(FORBIDDEN_INTERCEPTOR)
bind<Interceptor>()
}
both interceptors are declared in the same module but it ends up with
Copy code
NoBeanDefFoundException: No definition found for class:'okhttp3.Interceptor' q:' & qualifier:'forbiddenInterceptor''. Check your definitions!