Colton Idle

06/06/2020, 1:41 PM
I have a really basic dagger setup in my android app. I basically just followed the dagger guide/tutorial and now I went to add dagger-reflect by Jake Wharton, but now my basic setup won't compile because the
method isn't available on MyAppComponent. Anyone have any ideas? The readme doesn't say that I need to change anything. Opened an issue here as well EDIT 1: I did find this issue ( which seems similar, but it doesn't really have a solution? The last semi-helpful response there is to use
but I'm not sure how that helps. Android Dagger guide doesn't talk about that at all, which just makes it weird that dagger reflect doesn't work with a "typical"/basic dagger setup. EDIT 2: Also found this where Jake says "in general you should refactor to 
 and stateless modules." Maybe that's my solution? But how do I move my simple setup to "BindsInstance and stateless modules". That's going wayy over my head. In the same comment JW seems to mention that Builder() should also already work? Sorry for being a dagger noob here

Paul Woitaschek

06/07/2020, 5:37 AM
Use a factory
With kotlins named arguments you don't need a builder anyways
Either put your module there or make it stateless

Colton Idle

06/08/2020, 2:01 AM
@Paul Woitaschek thanks for the response. I think I'm going to try the Component Factory route for now since all of my dagger code is java. I'm interested in what you said about Kotlin named arguments though. How does that help me in this situation? "or make it stateless" Sorry. New to this. What do you mean make my component stateless? My networkModule requires a url to construct it, so I don't think I can "make it stateless".