title: Objects cannot be provided without an @Provides-annotated method
body: <p>I've started to setup Dagger 2 and faced a strange issue that looks like a bug to me.</p>
  
  <p>I have 1 main component and 1 subcomponent which I 'plus' in parent component. </p>
  
  <p>I use:</p>
  
  <pre><code>compile "com.google.dagger:dagger:2.4"
  apt "com.google.dagger:dagger-compiler:2.4"
  annotationProcessor "com.google.dagger:dagger-compiler:2.4"
  </code></pre>
  
  <p><strong>Application component</strong> is prety easy. It just 'plus' the subcomponent:</p>
  
  <pre><code>@Singleton @Component(modules = { AristocratsAppModule.class })
  public interface AristocratsAppComponent {
    StreamComponent plus(StreamModule module);
  }
  </code></pre>
  
  <p><strong>Application module</strong> also quite basic. It provides application level dependancies:</p>
  
  <pre><code>@Module public class AristocratsAppModule {
    private static AristocratsApp app;
  
    public AristocratsAppModule(AristocratsApp app) {
      AristocratsAppModule.app = app;
    }
  
    @Provides @Singleton AristocratsApp providesApplication() {
      return app;
    }
  
    @Provides @Singleton GsonXml providesGsonXml() {
      return ...
    }
  
    @Provides @Singleton @Named("aristocrats") Retrofit providesAristocratsRetrofit() {
      return ...
    }
  
    @Provides @Singleton @Named("last_fm") Retrofit providesLastFmRetrofit() {
      return ...
    }
  }
  </code></pre>
  
  <p><strong>Subcomponent</strong> has two StreamServices (Retrofit services) and simple inject:</p>
  
  <pre><code>@PerController @Subcomponent(modules = { StreamModule.class }) public interface StreamComponent {
    void inject(StreamsController streamsController);
  
    AristocratsStreamService providesAristocratsStreamService();
  
    LastFmStreamService providesLastFmStreamService();
  }
  </code></pre>
  
  <p><strong>Module of subcomponent</strong> provides presenter injection and two different injections of Retrofit services:</p>
  
  <pre><code>@Module public class StreamModule {
    private StreamsController mView;
  
    public StreamModule(StreamsController view) {
      mView = view;
    }
  
    @Provides @PerController StreamMvp.Presenter providesPresenter(StreamCase streamCase,
        StreamModelMapper streamMapper) {
      return new StreamPresenter(mView, streamCase, streamMapper);
    }
  
    @Provides @PerController AristocratsStreamService providesAristocratsStreamService(
        @Named("aristocrats") Retrofit retrofit) {
      return retrofit.create(AristocratsStreamService.class);
    }
  
    @Provides @PerController LastFmStreamService providesLastFmStreamService(
        @Named("last_fm") Retrofit retrofit) {
      return retrofit.create(LastFmStreamService.class);
    }
  }
  </code></pre>
  
  <p>Application injection that I call in onCreate() of my app class:</p>
  
  <pre><code>mAppComponent = DaggerAristocratsAppComponent.builder()
          .aristocratsAppModule(new AristocratsAppModule(this))
          .build();
  </code></pre>
  
  <p>View injection that I call in my controller:</p>
  
  <pre><code>getAppComponent().plus(new StreamModule(this)).inject(this);
  </code></pre>
  
  <p>Exception that I'm getting during build:</p>
  
  <pre><code>Error:(13, 8) error: [com.qsoft.streams.presentation.di.StreamComponent.inject(com.qsoft.streams.presentation.StreamsController)] com.qsoft.streams.data.network.AristocratsStreamService cannot be provided without an @Provides-annotated method.
  com.qsoft.streams.data.network.AristocratsStreamService is injected at
  com.qsoft.streams.data.network.StreamApi.&lt;init&gt;(…, streamServiceAristocrats, …)
  com.qsoft.streams.data.network.StreamApi is injected at
  com.qsoft.streams.data.repository.StreamRepository.&lt;init&gt;(streamApi, …)
  com.qsoft.streams.data.repository.StreamRepository is injected at
  com.qsoft.streams.domain.interactors.StreamCase.&lt;init&gt;(streamRepository)
  com.qsoft.streams.domain.interactors.StreamCase is injected at
  com.qsoft.streams.presentation.di.StreamModule.providesPresenter(streamCase, …)
  com.qsoft.streams.presentation.StreamMvp.Presenter is injected at
  com.qsoft.streams.presentation.StreamsController.mPresenter
  com.qsoft.streams.presentation.StreamsController is injected at
  com.qsoft.streams.presentation.di.StreamComponent.inject(streamsController)
  A binding with matching key exists in component: com.qsoft.streams.presentation.di.StreamComponent
  </code></pre>
  
  <p>Error complaints about missing <code>@Provides-annotated method</code> but they are inside my child module. Seems that Dagger2 just does not see them. I was thinking that the problem could be in the missing declaration of the <code>AristocratsStreamService</code> in subcomponent, so I even added it there but nothing changed.</p>
  
  <p>This situation looks very strange and I would like to hear some inputs from more experienced Dagger2 developers.</p>
  
  <p>Thank you in advance!</p>