I\'m trying to create a simple dagger 2 application while using support v4 fragments. After I modified my application I got this strange compilation error
Er
You need to put it in a module that you then register in your Component, but you don't have to declare it manually, as Dagger already has the AndroidInjectionModule
(or AndroidSupportInjectionModule
with AppCompat) which you can use.
You can find more about the Android setup in the official documentation or see some additional information in a similar question about when you need to install the module that was asked quite recently.
You're not showing your AppComponent, but you most likely just forgot to add the module, so you can fix your error by adding it to your component.
// add it somehow like this
@Component(modules = { AndroidSupportInjectionModule.class, AppModule.class })
public interface AppComponent {
void inject(App app);
}