provide context dagger 2
Вылетает ошибка при компиляции dagger 2
error: @Component.Builder is missing setters for required modules or components: [com.app.peshkariki.di.module.ContextModule] public static abstract interface Builder
Сам модуль
@Module
class ContextModule(private val application: MyApplication) {
@Singleton
@Provides
fun provideContext(): Context {
return application.applicationContext
}
}
Компонент
@Component(modules = [
ContextModule::class,
DBModule::class,
NetWorkModule::class
])
@Singleton
interface AppComponent {
@Component.Builder
interface Builder {
@BindsInstance
fun application(application: MyApplication): Builder
@BindsInstance
fun contextModule(appModule: ContextModule): Builder
fun build(): AppComponent
}
fun inject(mainActivity: MainActivity)
fun inject(apiService: ApiService)
}
Можете подсказать в чем может быть проблема?