Even I have this error, I suggest a way put the exact version they are giving the documentation.
For kotlin 1.9.22:
plugins {
...
id("com.google.dagger.hilt.android") version "2.51.1" apply false
}
//in app.gradle
plugins {
id("kotlin-kapt")
id("com.google.dagger.hilt.android")
}
android {
...
}
dependencies {
implementation("com.google.dagger:hilt-android:2.51.1")
kapt("com.google.dagger:hilt-android-compiler:2.51.1")
}
// Allow references to generated code
// I think this line is the GameChanger. I didn't see this in above response. suggestion and explanation are welcome..
kapt {
correctErrorTypes = true
}
Hence the Error will be solved
Upvote if your found Helpfull