title: Confusing error with Dagger 2 in Android
body: <p>I've been trying to set up a dependency injection but there is something that I can't deal with. I almost understand Dagger expect some weird issues like this one.</p>
  
  <p>Here is the log error:</p>
  
  <pre><code> e: /Users/costular/AndroidProjects/TransmissionRemote/app/build/tmp/kapt3/stubs/debug/com/costular/transmissionremote/di/components/ServerComponent.java:8: error: com.costular.transmissionremote.torrents.TorrentRepository cannot be provided without an @Inject constructor or from an @Provides- or @Produces-annotated method.
  e: 
  
  e:     public abstract void inject(@org.jetbrains.annotations.NotNull()
  e:                          ^
  e:       com.costular.transmissionremote.torrents.TorrentRepository is injected at
  e:           com.costular.transmissionremote.torrents.torrent_list.TorrentsActivity.torrentRepository
  e:       com.costular.transmissionremote.torrents.torrent_list.TorrentsActivity is injected at
  e:           com.costular.transmissionremote.di.components.ServerComponent.inject(activity)
  e: /Users/costular/AndroidProjects/TransmissionRemote/app/build/tmp/kapt3/stubs/debug/com/costular/transmissionremote/di/components/TorrentComponent.java:4: error: This @Singleton component cannot depend on scoped components:
  e: 
  
  e: @dagger.Component(modules = {com.costular.transmissionremote.di.modules.NetworkModule.class, com.costular.transmissionremote.di.modules.StorageModule.class, com.costular.transmissionremote.di.modules.TorrentModule.class}, dependencies = {com.costular.transmissionremote.di.components.ApplicationComponent.class})
  e: ^
  e:       @Singleton com.costular.transmissionremote.di.components.ApplicationComponent
  </code></pre>
  
  <p>Here is the code:
  <strong>ApplicationComponent.kt</strong></p>
  
  <pre><code>    @Singleton
  @Component(modules = arrayOf(ApplicationModule::class))
  interface ApplicationComponent {
  
      fun inject(myApp: MyApp)
  
      fun context(): Context
  
      fun app(): MyApp
  }
  </code></pre>
  
  <p><strong>ApplicationModule.kt</strong></p>
  
  <pre><code>    @Module
  class ApplicationModule(private val myApp: MyApp) {
  
      @Provides
      @Singleton
      fun provideApplication(): MyApp = myApp
  
      @Provides
      @Singleton
      fun providesContext(): Context = myApp.applicationContext
  
  }
  </code></pre>
  
  <p><strong>TorrentComponent.kt</strong></p>
  
  <pre><code> @Singleton
  @Component(
          modules = arrayOf(NetworkModule::class, StorageModule::class, TorrentModule::class),
          dependencies = arrayOf(ApplicationComponent::class)
  )
  interface TorrentComponent {
  
      fun inject(torrentsActivity: TorrentsActivity)
  
  }
  </code></pre>
  
  <p><strong>TorrentModule.kt</strong></p>
  
  <pre><code>    @Module
  class TorrentModule {
  
      @Singleton
  
  
       @Provides
          fun provideTorrentRepository(client: TransmissionClient): TorrentRepository = TorrentRepository(client)
  
      }
  </code></pre>
  
  <p><strong>NetworkModuke.kt</strong></p>
  
  <pre><code>@Module
  class NetworkModule(val host: String){
  
      @Provides
      @Singleton
      fun providesRPCClient(): TransmissionClient = TransmissionClient.getInstance(host)
  
  
  }
  </code></pre>
  
  <p><strong>TorrentsActivity.kt</strong></p>
  
  <pre><code> class TorrentsActivity : AppCompatActivity() {
  
      @Inject
      lateinit var torrentRepository: TorrentRepository
  
      lateinit var presenter: TorrentsPresenter
  
      private val fab by lazy { findViewById(R.id.fab) as FloatingActionButton }
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
          val toolbar = findViewById(R.id.toolbar) as Toolbar
          setSupportActionBar(toolbar)
  
          // Fab listener
          fab.setOnClickListener { presenter.addTorrent() }
  
          // Fragment initialization
          // Injection
          DaggerTorrentComponent.builder()
                  .applicationComponent((application as MyApp).applicationComponent)
                  .build()
  }
  </code></pre>
  
  <p>Thank you so much!</p>