Hilt Fragments must be attached to an @AndroidEntryPoint Activity. Found: class

Viewed 3538

Is it mandatory to add @AndroidEntryPoint annotation on all dependent classes like fragment dependent upon activity. Is there any alternative solution for overcome this exception?

1 Answers

Just add @AndroidEntryPoint to your parent Activity class:

enter image description here

And yes, it's a mandatory process if you want to use Hilt. You could use Dagger to get away with this.

Related