Dagger: IllegalArgumentException: No injector factory bound for Class

后端 未结 2 2009
名媛妹妹
名媛妹妹 2020-12-29 18:06

I am new to Dagger 2. I have 2 Activities, I want to use injected ViewModel for both. Here is my ViewModuleFactory :

@Singleton
public class         


        
2条回答
  •  灰色年华
    2020-12-29 18:24

    Using the @contrubutesAndroidInjector requires an additional annotationProcessor.

    Add this line to your gradle build file:

    annotationProcessor 'com.google.dagger:dagger-android-processor:2.11'
    

提交回复
热议问题