fix(upgrade): Align the androidx.hilt declarations with the resolved 1.2.0

addWorkerManager() needed androidx.hilt 1.2.0 for its KSP compiler, which left
addDagger() asking for 1.0.0 while conflict resolution silently handed it 1.2.0,
and hilt-compiler declared twice at two different versions.

The version moves to Versions.AndroidX.Hilt.core, addDagger() stays the single
place that registers hilt-common and the hilt-compiler, and addWorkerManager()
declares only hilt-work. Declared and resolved versions now match, so the
dependency report no longer shows a 1.0.0 -> 1.2.0 substitution.

No dependency graph change: 1.2.0 is what already resolved.
This commit is contained in:
darken
2026-08-18 17:55:19 +02:00
committed by Matthias Urhahn
parent 971fcbd34c
commit 70b9c2981e
2 changed files with 11 additions and 6 deletions
+4 -6
View File
@@ -44,13 +44,13 @@ fun DependencyHandlerScope.addBaseKotlin() {
fun DependencyHandlerScope.addDagger() {
implementation("com.google.dagger:dagger:${Versions.Dagger.core}")
implementation("com.google.dagger:dagger-android:${Versions.Dagger.core}")
implementation("androidx.hilt:hilt-common:1.0.0")
implementation("androidx.hilt:hilt-common:${Versions.AndroidX.Hilt.core}")
ksp("com.google.dagger:dagger-compiler:${Versions.Dagger.core}")
ksp("com.google.dagger:dagger-android-processor:${Versions.Dagger.core}")
implementation("com.google.dagger:hilt-android:${Versions.Dagger.core}")
ksp("androidx.hilt:hilt-compiler:1.0.0")
ksp("androidx.hilt:hilt-compiler:${Versions.AndroidX.Hilt.core}")
ksp("com.google.dagger:hilt-android-compiler:${Versions.Dagger.core}")
testImplementation("com.google.dagger:hilt-android-testing:${Versions.Dagger.core}")
@@ -140,10 +140,8 @@ fun DependencyHandlerScope.addWorkerManager() {
implementation("androidx.work:work-runtime-ktx:$version")
testImplementation("androidx.work:work-testing:$version")
// androidx.hilt 1.0.0's hilt-compiler ships no KSP SymbolProcessorProvider, so @HiltWorker
// would silently generate nothing under this project's KSP setup.
implementation("androidx.hilt:hilt-work:1.2.0")
ksp("androidx.hilt:hilt-compiler:1.2.0")
// @HiltWorker is processed by the androidx.hilt compiler that addDagger() already registers.
implementation("androidx.hilt:hilt-work:${Versions.AndroidX.Hilt.core}")
}
fun DependencyHandlerScope.addGlance() {
+7
View File
@@ -9,6 +9,13 @@ object Versions {
}
object AndroidX {
// 1.2.0 is a floor, not a preference: androidx.hilt's 1.0.0 compiler ships only a
// javax.annotation.processing.Processor, no KSP SymbolProcessorProvider, so under this
// project's KSP setup it generates nothing at all (e.g. for @HiltWorker).
object Hilt {
const val core = "1.2.0"
}
object Navigation {
const val core = "2.9.3"
}