Thread
#dagger
    Colton Idle

    Colton Idle

    2 years ago
    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
    builder()
    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 https://github.com/JakeWharton/dagger-reflect/issues/191 EDIT 1: I did find this issue (https://github.com/JakeWharton/dagger-reflect/issues/145) which seems similar, but it doesn't really have a solution? The last semi-helpful response there is to use
    @Component.Factory
    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 https://github.com/JakeWharton/dagger-reflect/issues/4 where Jake says "in general you should refactor to 
    @BindsInstance
     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

    Paul Woitaschek

    2 years ago
    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

    Colton Idle

    2 years ago
    @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".