Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 926
M.Muzammil Avatar asked Jul 09 '20 09:07

M.Muzammil


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.

like image 172
Jim Avatar answered Sep 28 '22 09:09

Jim