Dagger: how to install Install AndroidInjectionModule in my application component

Created on 26 Mar 2017  路  4Comments  路  Source: google/dagger

hi.based on documentation, for use dagger we should install AndroidInjectionModule in Application Component.but i dont Know how to install it in my component.please help me.thanks

Most helpful comment

It refers to your app component. You need to list it as one of the modules in @Component(modules = { AndroidInjectionModule.class }). For example:

@Component(modules = { AndroidInjectionModule.class, AppModule.class })
public interface AppComponent {
    void inject(App app);
}

All 4 comments

It refers to your app component. You need to list it as one of the modules in @Component(modules = { AndroidInjectionModule.class }). For example:

@Component(modules = { AndroidInjectionModule.class, AppModule.class })
public interface AppComponent {
    void inject(App app);
}

You would want to add those

  compile 'com.google.dagger:dagger-android:2.10'
  compile 'com.google.dagger:dagger-android-support:2.10'

@Nimrodda And @oldergod Thanks a lot.

Hi @ronshapiro, why is this issue closed? This is a bug in the documentation. This issue should be fixed by updating the documentation.

Was this page helpful?
0 / 5 - 0 ratings