Hilt dependency in toml file with KSP
Add Hilt and KSP in toml file
[libraries]
hilt-android = { group = "com.google.dagger", name = "hilt-android" ,
version.ref = "hiltVersion"}
hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler" ,
version.ref = "hiltVersion"}
[plugins]
kotlinAndroidKsp = { id = "com.google.devtools.ksp", version.ref =
"kspVersion" }
hiltAndroid = { id = "com.google.dagger.hilt.android", version.ref =
"hiltVersion" }
Add Plugin In Project build.gradle.kts
alias(libs.plugins.hiltAndroid) apply false
alias(libs.plugins.kotlinAndroidKsp) apply false
Add Plugin in app build.gradle.kts
alias(libs.plugins.kotlinAndroidKsp)
alias(libs.plugins.hiltAndroid)
Add hilt dependency in app build.gradle.kts
implementation(libs.hilt.android)
ksp(libs.hilt.compiler)
Now Sync gradle build and error will resolved
Happy coding :)