Hello, everybody, I created an app with Hilt DI, b...
# android
h
Hello, everybody, I created an app with Hilt DI, but I'm new at DI. The app works well, but when I remove Hilt's annotations, the app works well again. How is possible? Can Hilt work without its annotations.
😶 3
a
Did you remove all annotations? Or just any specific ones?
h
@Antony thanks for replying. I did both and the app works again. There is application class and it's class's name exists in Manifest.
a
Are you saying that your dependencies are being injected even when you haven't annotated the application class? Only if you try to inject something and try to access it you can tell it is working without the other annotations.
h
@Antony, 'Are you saying that your dependencies are being injected even when you haven't annotated the application class? '-> Yes. Is there any way that checks if the app works with Hilt DI or no? Maybe the app doesn't work with Hilt DI.
c
Also there may be a cache. I would make sure you clean and then rerun without annotations and see if it still works. If you do find something reproducible you can ask in #dagger
h
@Colton Idle, I've done it, but it didn't help. Can Application class be empty?
k
I would think that the annotation create files when compiling. Unless you did a full clean, those files will still be there
☝️ 2
h
@kevindmoore, thanks for replying.  I   clicked  clean && rebuild project, clicked invalidate caches , deleted the app and install it again in my phone, removed some annotations, but there is no result, the app works again. Even the app works when I use wrong annotations 🤔
c
Maybe you're hitting this issue where an old (and working version of the app installs) even though the build failed. https://issuetracker.google.com/issues/191997469