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

Issue with Dagger Hilt Upgrade from 2.48 to 2.49 - Unable to Load Class JavacBasicAnnotationProcessor #4385

Open
HashemDeveloper opened this issue Aug 9, 2024 · 1 comment

Comments

@HashemDeveloper
Copy link

HashemDeveloper commented Aug 9, 2024

Hi Dagger Hilt Team,

I encountered an issue while upgrading Dagger Hilt from version 2.48 to 2.49. Upon attempting the upgrade, the following error was thrown:

Unable to load class 'dagger.spi.shaded.androidx.room.compiler.processing.javac.JavacBasicAnnotationProcessor'
dagger.spi.shaded.androidx.room.compiler.processing.javac.JavacBasicAnnotationProcessor

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
- Re-download dependencies and sync project (requires network)
- The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
- Stop Gradle build processes (requires restart)
- Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

Project Setup:
In project.gradle:

plugins {
    ...
    id 'com.google.dagger.hilt.android' version '2.48' apply false
    ...
}

In all other app module.gradle files:

plugins {
    ...
    id 'kotlin-kapt'
    id 'dagger.hilt.android.plugin'
}
dependencies {
    // Dagger Hilt
    implementation libs.daggerhilt.version
    kapt libs.hilt.android.compiler
    implementation(libs.android.hilt.nav.v)
    implementation libs.android.hilt.nav.compose
}

The project setup and dependency configuration are consistent across modules, and this issue appears only after attempting to upgrade to 2.49.

Could you please provide guidance on how to resolve this issue? Any insights or suggestions to troubleshoot and fix the problem would be greatly appreciated.

Thank you!

@kuanyingchou
Copy link
Collaborator

Hi, @HashemDeveloper , this could happen if your Hilt Gradle Plugin version doesn't match the other Hilt dependencies. For example, in your project.gradle you could still be using 2.48 instead of 2.49:

id 'com.google.dagger.hilt.android' version '2.48' apply false

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

2 participants