fragmentDispatchingAndroidInjector while using support fragments

血红的双手。 提交于 2019-12-01 18:23:56

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);
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!