Hi, I am having some problems with Hilt dependency...
# android
Hi, I am having some problems with Hilt dependency injection. If I clean the project and then build, it builds just fine. But gives me ‘Unresolved reference’ on a bunch of my injected view models if I change anything in my activities/fragments and try and build again without cleaning. I have tried all different kinds of configurations in my gradle files, to no avail, me configuration looks like this:
Sometimes it gives me a circular dependency error, but I cannot identify it:
It works after a clean? But only fails after you change things? Seems pretty typical of my experience. Be sure to hit run again after a failure. That typically works for me.
It forces me to clean the build folder after each change I make to any file in the project. Do you clean your build folder after each change?
Typically only after changing files that have any of the hilt annotations. In any case, I do think what you have above is probably worth filing a bug for on daggers repo. They've been really fast to respond to me on issues in the past. Maybe someone there can spot something. Or if you don't want to escalate to that, then maybe #dagger first?
@Manuel Vivo sorry for the ping, but maybe you can spot something wrong in this setup?
That’s indeed odd! Does it keep happening if you bump the Hilt dependency to the latest?
Thanks for responding, and sorry for not answering sooner. I tried bumping to a newer version, still not working. I might try to post on their forums. 🙂