iammert / dagger-android-injection

Sample project explains Dependency Injection in Android using dagger-android framework.
515 stars 130 forks source link

How can I add modules to fragment binder? #13

Closed ibrahimsn98 closed 6 years ago

ibrahimsn98 commented 6 years ago

I want to add some modules to fragment binder. For example, @ContributesAndroidInjector(modules = {RoomModule.class, RestServiceModule.class, UtilsModule.class}) abstract WatchedMoviesFragment provideWatchedMoviesFragmentFactory();

But I need to write setters for this modules. Where should I do that? Error: @Subcomponent.Builder is missing setters for required modules or subcomponents: [xx.RoomModule, xx.UtilsModule]

ibrahimsn98 commented 6 years ago

I fixed that issue by adding Application Module to fragment's modules