title: I can't inject Dao to a Repository Class, with HILT, in Android
body: <p>i follow this tutorial <a href="https://www.youtube.com/watch?v=eVsiefsFuoQ" rel="nofollow noreferrer">Room Dependency Injection - MVVM To-Do List App with Flow and Architecture Components #4</a></p>
  <p>Now I want to convert, a hole app that I have with Room, to this Clean Architecture.
  In the tutorial Florian uses DI, to inject TaskDao into TaskViewModel, but I have a Repositories clases.</p>
  <p>So I get to a point where the app is build without errors.</p>
  <p>and this is my Repository:</p>
  <pre><code>    class AnioRepository constructor(
          private val agrotrackerApi: AgrotrackerApi
      ) {
      val TAG = &quot;AnioRepository&quot;
      //val anioDao: AnioDao
  
      fun downloadAnios(): AniosResponse? {
          GlobalScope.launch(Dispatchers.IO) {
              val result = agrotrackerApi.getAnios()
              if (result.isSuccessful) {
                  for (anio in result.body()!!){
                      Log.d(TAG, anio.toString())
                  }
              }
          }
          return null
      }
  
      fun getAnios() {
          //anioDao.getListAnios()
      }
  
      }
  </code></pre>
  <p>and this is my RepositoryModule:</p>
  <pre><code>@Module
  @InstallIn(ApplicationComponent::class)
  object RepositoryModule {
  
      @Singleton
      @Provides
      fun providesAnioRepository( agrotrackerApi: AgrotrackerApi) : AnioRepository {
          return AnioRepository(agrotrackerApi)
      }
  
  }
  </code></pre>
  <p>So I'm trying to add Dao class to the Repository Class, like this:</p>
  <pre><code>class AnioRepository constructor(
          private val anioDao: AnioDao,
          private val agrotrackerApi: AgrotrackerApi
      ) {
      val TAG = &quot;AnioRepository&quot;
     ...
  </code></pre>
  <p>and then, change RepositoryModule, to match constructor...</p>
  <pre><code>...
      fun providesAnioRepository( anioDao: AnioDao, agrotrackerApi: AgrotrackerApi) : AnioRepository 
          =  AnioRepository(anioDao, agrotrackerApi)
  ...
  </code></pre>
  <p>but when I press Ctrl-F9, i get this error:</p>
  <blockquote>
  <p>public abstract class ATMDatabase extends androidx.room.RoomDatabase {
  ^C:\pryectos\AndroidStudioProjects\ATMobileXKt\app\build\generated\source\kapt\debug\com\cse\atm\ATMApplication_HiltComponents.java:155:
  error: [Dagger/MissingBinding] @com.cse.atm.di.ApplicationScope
  kotlinx.coroutines.CoroutineScope cannot be provided without an
  @Provides-annotated method.   public abstract static class SingletonC
  implements ATMApplication_GeneratedInjector,
  ^
  @com.cse.atm.di.ApplicationScope kotlinx.coroutines.CoroutineScope is injected at
  com.cse.atm.database.ATMDatabase.Callback(�, applicationScope)
  com.cse.atm.database.ATMDatabase.Callback is injected at
  com.cse.atm.di.AppModule.providesDatabase(�, callback)
  com.cse.atm.database.ATMDatabase is injected at
  com.cse.atm.di.AppModule.providesAnioDao(db)
  com.cse.atm.database.AnioDao is injected at
  com.cse.atm.di.RepositoryModule.providesAnioRepository(anioDao, �)
  javax.inject.Provider&lt;com.cse.atm.data.AnioRepository&gt; is injected at</p>
  </blockquote>
  <p>What means this error? What I'm missing ?</p>
  <p>@ApplicationScope annotation is in another AppModule.kt, I dont' where is the problem.</p>
  <p>Any help wil be appreciated!!</p>
  <p>Best Regards</p>