title: Injecting Implementations From Another Gradle Module in Hilt
body: <p>I'm trying to use hilt to inject an implementation of a repository class(the interface lives in the <code>domain</code> module, the implementation in the <code>data</code> module with the <code>data</code> module depending on the <code>domain</code> one) but receiving an error when building the app. Here's my setup</p>
  <p>In <code>domain</code> module</p>
  <pre><code>interface RatesRepository {
      fun getRates(): Single&lt;Rates&gt;
  }
  </code></pre>
  <p>in <code>data</code> module</p>
  <pre><code>class RatesRepositoryImpl @Inject constructor(
      private val rateDataSource: CurrencyExchangeDataSource,
      private val mapper: ExchangeResponseToRates
  ) : RatesRepository {
  //..
  }
  
  @Module
  @InstallIn(FragmentComponent::class)
  interface DataModule {
      @Binds
      fun bindsRatesRepository(ratesRepositoryImpl: RatesRepositoryImpl): RatesRepository
  }
  </code></pre>
  <p>and data declares domain as a dependency</p>
  <p>EDIT:
  the error I'm receiving :</p>
  <pre><code>error: [Dagger/MissingBinding] com.basil.domain_converter.repository.RatesRepository cannot be provided without an @Provides-annotated method.
    public abstract static class ApplicationC implements CurrenciesApp_GeneratedInjector,
                           ^
        com.basil.domain_converter.repository.RatesRepository is injected at
            com.basil.domain_converter.usecase.GetRatesUseCase(ratesRepository)
        javax.inject.Provider&lt;com.basil.domain_converter.usecase.GetRatesUseCase&gt; is injected at
            com.basil.ui_converter.ui.RatesViewModel_AssistedFactory(getRatesUseCase)
        com.basil.ui_converter.ui.RatesViewModel_AssistedFactory is injected at
            com.basil.ui_converter.ui.RatesViewModel_HiltModule.bind(arg0)
        java.util.Map&lt;java.lang.String,javax.inject.Provider&lt;androidx.hilt.lifecycle.ViewModelAssistedFactory&lt;? extends androidx.lifecycle.ViewModel&gt;&gt;&gt; is injected at
            androidx.hilt.lifecycle.ViewModelFactoryModules.ActivityModule.provideFactory(…, viewModelFactories)
        @dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory java.util.Set&lt;androidx.lifecycle.ViewModelProvider.Factory&gt; is requested at
            dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories.ActivityEntryPoint.getActivityViewModelFactory() [com.basil.example.CurrenciesApp_HiltComponents.ApplicationC → com.basil.example.CurrenciesApp_HiltComponents.ActivityRetainedC → com.basil.example.CurrenciesApp_HiltComponents.ActivityC]
    The following other entry points also depend on it:
        dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories.FragmentEntryPoint.getFragmentViewModelFactory() [com.basil.example.CurrenciesApp_HiltComponents.ApplicationC → com.basil.example.CurrenciesApp_HiltComponents.ActivityRetainedC → com.basil.example.CurrenciesApp_HiltComponents.ActivityC → com.basil.example.CurrenciesApp_HiltComponents.FragmentC]
  </code></pre>