I am trying to follow the Hilt migration guide here: https://dagger.dev/hilt/migration-guide.html
And have annotated all my modules with:
@InstallIn(SingletonComponent::class)
However I am running into issues with my "Contributor" Modules for services, fragments and activities.
I have one module for each,
@Module
@InstallIn(SingletonComponent::class)
abstract class FragmentContributorModule {
@ContributesAndroidInjector
internal abstract fun contributeMyFragment(): MyFragment
}
@Module
@InstallIn(SingletonComponent::class)
abstract class ActivityContributorModule {
@ContributesAndroidInjector
internal abstract fun contributeMyActivity(): MyActivity
}
@Module
@InstallIn(SingletonComponent::class)
abstract class ServiceContributorModule {
@ContributesAndroidInjector
internal abstract fun contributeMyService(): MyService
}
During compile I am getting errors for each one of the "contribute" functions:
com.test.ActivityContributorModule_ContributeMyActivity$defaultsDebug is missing an @InstallIn annotation. If this was intentional, see https://dagger.dev/hilt/compiler-options#disable-install-in-check for how to disable this check.
I have also tried to use ServiceComponent::class, FragmentComponent::class and ActivityComponent::class for each Module with no luck. I am trying to migrate the project in pieces so I don't think I can remove these until everything is upgraded to Hilt.
Any ideas?