I just started using Dagger Hilt for dependency injection on Android and I get a warning on Android Studio saying 'ApplicationComponent' is deprecated. Deprecated in Java.
I didn't find anything related to this warning while Googling, is it actually deprecated or is it safe to use?
I also noticed on Dagger's website that they don't mention it anywhere in the "Migrating to Hilt" guide and they use @InstallIn(SingletonComponent::class) which seems to be working but I have no idea why.
ApplicationComponent being renamed to SingletonComponent, to allow usage of Hilt in non-Android Gradle modules link
Is ApplicationComponent deprecated?
Yes, it is deprecated.
Instead of ApplicationComponent, you can use SingletonComponent.
This is an Hilt component for singleton bindings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With