Dagger2: no injector factory bound for fragment

后端 未结 3 807
孤独总比滥情好
孤独总比滥情好 2021-01-04 05:44

I\'m trying to convert a project that I\'m building to use the dagger-android API for the DI framework, but I\'m running into a dead end with an IllegalArgumentException whe

3条回答
  •  礼貌的吻别
    2021-01-04 06:23

    in my case, I did not define the Fragment in @Module class! so When I added it like :

    @ActivityScope
    @ContributesAndroidInjector(modules = {ActivityModule.class})
    abstract InvestmentDetailsFragment bindInvestmentDetailsFragment();
    

    my problem fixed!

提交回复
热议问题