plugins {
// other plugins
id("com.google.dagger.hilt.android") version "2.49" apply false
}
plugins {
// other plugins
id("kotlin-kapt")
id("dagger.hilt.android.plugin")
}
dependencies {
// other dependencies
// Dagger Hilt
implementation("com.google.dagger:hilt-android:2.49")
kapt("com.google.dagger:hilt-android-compiler:2.49")
}
kapt {
correctErrorTypes = true
}
Make sure to include the following in your compileOptions
:
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
Dagger 2.48 (or above)
KSP 1.9.0-1.0.12 (or above)
plugins {
// other plugins
id("com.google.devtools.ksp") version "1.9.0-1.0.12" apply false
id("com.google.dagger.hilt.android") version "2.49" apply false
}
plugins {
// other plugins
id("com.google.devtools.ksp")
id("dagger.hilt.android.plugin")
}
dependencies {
// other dependencies
// Dagger Hilt
implementation("com.google.dagger:hilt-android:2.49")
ksp("com.google.dagger:hilt-android-compiler:2.49")
}
Make sure to set the Kotlin version in your libs.versions.toml
(Version Catalog):
kotlin = "1.9.0" # or above