After upgrading dagger hilt(version: 2.31-alpha
) ApplicationComponent.class
can not find.
What is the alternative for a Component
like RoomDatabase?
@Module
@InstallIn(ApplicationComponent::class)
class RoomModule() {
private val DATABASE_NAME = "salat_time"
@Singleton
@Provides
fun provideRoomDatabase(@ApplicationContext appContext: Context) = Room.databaseBuilder(
appContext,
AppDatabase::class.java,
DATABASE_NAME
).createFromAsset("db/$DATABASE_NAME.sqlite").build()
@Singleton
@Provides
fun provideLocalSalatRepository(database: AppDatabase) = LocalSalatRepository(database)
@Singleton
@Provides
fun provideDistrictRepository(database: AppDatabase) = DistrictRepository(database)
}