Stumbling on how to get this working correctly wit...
# dagger
c
Stumbling on how to get this working correctly with dagger2 + kotlin
Copy code
@Provides
fun provideApiService( <========== ERROR: error: [Dagger/MissingBinding] okhttp3.Interceptor cannot be provided without an @Provides-annotated method.
    @Named("application_interceptors") applicationInterceptors: MutableList<Interceptor>,
    @Named("network_interceptors") networkInterceptors:  MutableList<Interceptor>,
Providers:
Copy code
@Provides
@Named("application_interceptors")
fun provideApplicationInterceptorList(
    @ApplicationContext context: Context,
): MutableList<Interceptor> {
and
Copy code
@Provides
@Named("network_interceptors")
fun provideNetworkInterceptorList(
    @ApplicationContext context: Context,
): MutableList<Interceptor> {
a
Probably need to use @JvmSuppressWildcards Try this instead MutableList<@JvmSuppressWildcards Interceptor>
c
Same issue. error: [Dagger/MissingBinding] okhttp3.Interceptor cannot be provided without an @Provides-annotated method.
f
You can't provide MutableList, you can only do Set, List, Map (immutables)
c
This seems to work. Thank you
@JvmSuppressWildcards List<Interceptor>
231 Views