You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an issue when switching Hilt’s annotation processing from KAPT to KSP in my project. My setup uses KSP for Room, and I attempted to also use KSP for Hilt’s compiler by replacing:
kapt(libs.hilt.android.compiler)
with
ksp(libs.hilt.android.compiler)
However, this change causes the build to fail with the following error during KSP processing:
> Task :app:kspDebugKotlin
e: java.lang.NoSuchMethodError: 'java.util.List org.jetbrains.kotlin.load.java.JvmAnnotationNamesKt.getNOT_NULL_ANNOTATIONS()'
at com.google.devtools.ksp.symbol.impl.java.KSTypeReferenceJavaImpl.resolve(KSTypeReferenceJavaImpl.kt:134)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KspTypeElement$superInterfaces$2$1.invoke(KspTypeElement.kt:123)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KspTypeElement$superInterfaces$2$1.invoke(KspTypeElement.kt:122)
...
It appears that a required method (getNOT_NULL_ANNOTATIONS()) is missing from the Kotlin runtime, which suggests a potential version incompatibility between the following components:
Android Gradle Plugin (AGP)
Kotlin
Dagger Hilt (and Hilt Android Compiler)
KSP
Project Configuration:
ViewModel & Application:
I have a minimal MainViewModel annotated with @HiltViewModel:
[versions]hiltAndroidCompiler = "2.51.1"hiltAndroid = "2.55"kotlin = "2.0.0"roomRuntime = "2.6.1"agp = "8.8.0"
// ... other versions as defined in the catalog
Thank you for your time and assistance!
The text was updated successfully, but these errors were encountered:
Hi Dagger Hilt Team,
I am encountering an issue when switching Hilt’s annotation processing from KAPT to KSP in my project. My setup uses KSP for Room, and I attempted to also use KSP for Hilt’s compiler by replacing:
with
However, this change causes the build to fail with the following error during KSP processing:
It appears that a required method (
getNOT_NULL_ANNOTATIONS()
) is missing from the Kotlin runtime, which suggests a potential version incompatibility between the following components:Project Configuration:
ViewModel & Application:
I have a minimal
MainViewModel
annotated with@HiltViewModel
:My Application class is annotated with
@HiltAndroidApp
:Gradle Configuration:
In my module’s
build.gradle.kts
, I use both KAPT and KSP plugins:Versions (from my version catalog):
Thank you for your time and assistance!
The text was updated successfully, but these errors were encountered: