I'm using kotlin latest version and trying to implement dagger2, but after rebuilding the project the suggestions would never give me "DaggerAppComponent" to build.
my dependencies
implementation 'com.google.dagger:dagger:2.38.1'
implementation 'com.google.dagger:dagger-android:2.38.1'
implementation 'com.google.dagger:dagger-android-support:2.35.1'
annotationProcessor 'com.google.dagger:dagger-compiler:2.38.1'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.38.1'
And I already added
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
}
here is my AppComponent class,
@Component (
modules = [
AndroidSupportInjectionModule::class,
])
interface AppComponent: AndroidInjector<BaseApplication>{
@Component.Builder
interface Builder {
@BindsInstance
fun application(application: Application): Builder
fun build(): AppComponent
}
}
And here is my Application class, already added to manifests as well,
class BaseApplication: DaggerApplication() {
override fun applicationInjector(): AndroidInjector<out DaggerApplication>? {
return null
}
}
I already tried adding kapt instead of using annotationProcessor but won't make any difference. Can somebody help me, I'm almost spent an entire day on this error!