Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KSP2] Dagger and Hilt incompatibility with KSP2 #4303

Open
SimonMarquis opened this issue May 7, 2024 · 2 comments
Open

[KSP2] Dagger and Hilt incompatibility with KSP2 #4303

SimonMarquis opened this issue May 7, 2024 · 2 comments

Comments

@SimonMarquis
Copy link

Original issue reported on KSP google/ksp#1841

KSP tasks are failing because of a Hilt error when building with Kotlin 2.0.0-RC1 and KSP2 enabled:

  • SimonMarquis/QrCode
    > Task :app:kspDebugKotlin
    e: [ksp*** [Hilt*** Class java.lang.Object is not annotated with @AssistedFactory.
    [Hilt*** Processing did not complete. See error above for details.
    e: [ksp*** [Hilt*** Expected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin? (com.google.dagger.hilt.android)
    See https://dagger.dev/hilt/gradle-setup.html
    [Hilt*** Processing did not complete. See error above for details.
    e: [ksp*** [Hilt*** Expected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin? (com.google.dagger.hilt.android)
    See https://dagger.dev/hilt/gradle-setup.html
    [Hilt*** Processing did not complete. See error above for details.
    e: [ksp*** [Hilt*** Expected @HiltAndroidApp to have a value. Did you forget to apply the Gradle Plugin? (com.google.dagger.hilt.android)
    See https://dagger.dev/hilt/gradle-setup.html
    
  • android/nowinandroid
    > Task :ui-test-hilt-manifest:kspDemoDebugKotlin FAILED
    e: [ksp] [Hilt] Expected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin? (com.google.dagger.hilt.android)
    See https://dagger.dev/hilt/gradle-setup.html
    [Hilt] Processing did not complete. See error above for details.
    
    > Task :core:analytics:kspDemoDebugKotlin FAILED
    e: [ksp] java.lang.NullPointerException: null cannot be cast to non-null type androidx.room.compiler.processing.XType
    
    This stacktrace also contains an error referenced in this KSP issue:
@danysantiago danysantiago changed the title [KSP2] Hilt incompatibility: Did you forget to apply the Gradle Plugin? [KSP2] Hilt incompatibility May 8, 2024
@danysantiago danysantiago changed the title [KSP2] Hilt incompatibility [KSP2] Dagger and Hilt incompatibility with KSP2 May 8, 2024
@danysantiago
Copy link
Member

Dagger / HIlt currently does not support KSP2 as we are still working through the various breaking changes in the APIs. Moreover, the underlying processing library used by Dagger and Hilt (called XProcessing) needs to also be migrated, tracking issue is https://issuetracker.google.com/314151707

@G00fY2
Copy link

G00fY2 commented May 22, 2024

@danysantiago I assume that you are aware of this, but for transparency reasons I wanted to point out that KSP1 will not be supported with Kotlin 2.1:

KSP1 will not support Kotlin 2.1. Please plan transitioning from KSP1 to KSP2 during Kotlin 2.0.

Referring to the Kotlin documentation we can expect Kotlin 2.1 at the end of the year (Nov/Dec 2024).

Language releases (2.x.0) that bring major changes in the language and include tooling updates. Released once in 6 months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants