I am new at the dependency injection on Android. I am using Dagger-Hilt and in AppModule class that I generated for the DB providers I got an error and the project doesn't compile.
The error is @InstallIn can only be used on @Module or @EntryPoint classes
This is my AppModule object. Where do I make mistake?
@Module
@InstallIn(ApplicationComponent::class)
object AppModule {
@Singleton
@Provides
fun provideAppDatabase(
@ApplicationContext app: Context
) = Room.databaseBuilder(
app,
AppDatabase::class.java,
"gelirkenal"
).build()
@Singleton
@Provides
fun provideItemDao(db: AppDatabase) = db.itemDao()
}