title: Dagger2 and qualifiers in dependent components
body: <p>I have an app component and a dependent component. The app component declares explicit dependencies, and the dependent component can inject those. However, when I have a dependency that I have to disambiguate with a @Qualifier, the dependent component is not able to inject that dependency.</p>
  
  <p>This is the app component</p>
  
  <pre><code>@Component(modules = [AppModule::class, SchedulersModule::class, StorageModule::class])
  
  @ApplicationScope
  interface AppComponent {
      fun inject(app: Application)
      /* other stuff omitted for brevity */
      val bitmapCache: BitmapCache        
      @UiScheduler fun uiScheduler(): Scheduler
  }
  </code></pre>
  
  <p>This is the scheduler module:</p>
  
  <pre><code>@Module
  class SchedulersModule {
      @ApplicationScope
      @Provides
      @IoScheduler
      fun provideIoScheduler(): Scheduler = Schedulers.io()
  
      @ApplicationScope
      @Provides
      @UiScheduler
      fun provideMainThreadScheduler(): Scheduler = AndroidSchedulers.mainThread()
  }
  </code></pre>
  
  <p>This is the qualifier:</p>
  
  <pre><code>@Qualifier
  @Retention(AnnotationRetention.RUNTIME)
  annotation class UiScheduler
  </code></pre>
  
  <p>And this is the dependent component:</p>
  
  <pre><code>@Component(
          dependencies = [AppComponent::class],
          modules = [EditEntryActivityModule::class, ViewModelModule::class]
  )
  
  @ActivityScope
  interface EditEntryActivityComponent {
      fun inject(editEntryActivity: EditEntryActivity)
      fun inject(editEntryFragment: EditEntryFragment)
  }
  </code></pre>
  
  <p>This is how the scheduler is injected in the fragment:</p>
  
  <pre><code>class EditEntryFragment : Fragment() {
      @Inject @UiScheduler lateinit var uiScheduler: Scheduler
      /* other stuff */
  }
  </code></pre>
  
  <p>So why can the dependent component inject the bitmap cache, declared in the parent component, but not the UI scheduler? This is the error I get:</p>
  
  <pre><code>error: io.reactivex.Scheduler cannot be provided without an @Provides- or @Produces-annotated method.
    io.reactivex.Scheduler is injected at
        com.test.edit.EditEntryFragment.uiScheduler
    com.test.edit.EditEntryFragment is injected at
        com.test.edit.EditEntryActivityComponent.inject(arg0)
  1 error
  </code></pre>