Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] dependency injection – Android Hilt DI – error: package {ApplicationClassName}_HiltComponents does not exist

Posted on November 14, 2022

Solution 1 :

Just Build -> Rebuild Project worked for me.

If someone else has the same problem and rebuilding the project doesn’t work, feel free to comment your problem. If someone knows why it happens, please enlighten us with your answer.

Solution 2 :

For me none of the above worked. What fixed the issue was updating build tools and gradle wrapper to most recent versions.

Gradle wrapper from

distributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip

to

distributionUrl=https://services.gradle.org/distributions/gradle-6.7-all.zip

And Build tools from

   buildToolsVersion '29.0.1'

to

   buildToolsVersion '29.0.3'

Solution 3 :

For me, i had a similar error because the Hilt gradle plugin was defined with different version than Hilt dependency.

classpath("com.google.dagger:hilt-android-gradle-plugin:2.38.1")

And Hilt dependency was:

implementation("com.squareup.retrofit2:retrofit:2.40")

Using 2.40 for both fixed it.

Problem :

I am using the new Hilt library for Dependency Injection version 2.28-alpha. I have followed the Hilt documentation and annotated the Application class with the @HiltAndroidApp annotation. But when I am trying to build my project, its throwing a huge list of errors all similar to:

error: package {ApplicationClassName}_HiltComponents does not exist

public final class Dagger{ApplicationClassName}_HiltComponents_ApplicationC extends 
{ApplicationClassName}_HiltComponents.ApplicationC {

I have searched for it but since its a new library, there is not much QnA available for it. Why is it throwing that error and how do I resolve it?

Comments

Comment posted by Taki

did you add the application class to your manifest file ?

Comment posted by Taki

Can you show your module and application class code ?

Comment posted by Ashu

@takieddine yes i already had my class added to the manifest. I don’t know but rebuilding the project worked. Thanks for your help

Comment posted by Udit

same problem. does anybody have any solution other than rebuilding because that didn’t help

READ  [ANSWERED] layout - Android rounded ImageView
Powered by Inline Related Posts

Comment posted by Seven

Wow, I can’t believe this did the trick. I guess the issue was something that was left in cache and rebuilding the project just got rid of it…

Comment posted by Ashu

@Seven Yep. It happens quiet some times. Just

Comment posted by Udit

rebuilding the project is not helping me :/

Comment posted by Ashu

Hi @Udit… can you elaborate your problem? Have you tried invalidating cache as well? What’s happening on your end?

Comment posted by MJ Studio

This seems to a bug of Hilt itself. In my case, the renaming module class resolved this.

Comment posted by Sai

In my case I missed to update com.google.dagger:hilt-android version but I updated everywhere else.

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress