You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an exercise purpose, I'm trying to add Dagger Reflect to Plaid project. After all necessary changes to make project compile I got runtime crash.
The issue is that HomeActivity should be injected by HomeComponent. The issue is that HomeComponent doesn't declare the inject method directly but rather implements generic injector interface BaseActivityComponent. Which implements BaseComponent that has generic method
fun inject(target: T)
During debug, I see that reflection is looking to parameter type of the method declaration which is resoled to Object rather than taking the type of the passed parameter HomeActivity.
I wonder what are you thoughts about the issue and the approach taken in the plaid app?
The text was updated successfully, but these errors were encountered:
I've spent a fair bit of time trying to get dagger reflect to work in a large project and although most things CAN be worked around with reasonable effort, the lack of support for generics is what blocks me - eliminating them in this particular code base is sadly not a tempting approach at the moment. I will report my other findings in other tickets.
In case anyone else digs into this, I found it useful to catch the unwanted generics at this point in the code in the debugger and then I could peek around in the scope to try to figure out what I really wanted:
As an exercise purpose, I'm trying to add Dagger Reflect to Plaid project. After all necessary changes to make project compile I got runtime crash.
The issue is that HomeActivity should be injected by HomeComponent. The issue is that HomeComponent doesn't declare the inject method directly but rather implements generic injector interface BaseActivityComponent. Which implements BaseComponent that has generic method
During debug, I see that reflection is looking to parameter type of the method declaration which is resoled to Object rather than taking the type of the passed parameter HomeActivity.
I wonder what are you thoughts about the issue and the approach taken in the plaid app?
The text was updated successfully, but these errors were encountered: