Dagger 2 and android Studio: working but can't see generated classes

前端 未结 2 570
花落未央
花落未央 2021-01-01 13:09

I\'m trying to use Dagger 2 in an Android Studio Project. I\'ve used the CoffeeMaker example. I\'ve managed to make the app build and working however: - I don\'t success in

2条回答
  •  天命终不由人
    2021-01-01 13:56

    I stumbled upon same problem, in my case I was testing new classes and tried to inject them separately into my main class, in that case Dagger won't generate any DaggerComponents from factory.

    Simply, remember to put all injections that goes into one class in one Module & one Component. You cannot inject more than one DaggerComponent into one class. Besides that's the point of those components, to aggregate injected classes

提交回复
热议问题