Dagger 2 component not generated

前端 未结 12 1722
走了就别回头了
走了就别回头了 2021-01-31 07:21

In my module, in my base Application class

component = DaggerCompClassComponent.builder()
                .classModule(new ModuleClass()).build();
12条回答
  •  無奈伤痛
    2021-01-31 08:16

    In my case it wasn't being created only in Instrumentation Testing, because I was missing

    kaptAndroidTest "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
    

    Of course I'm using Kotlin and $rootProject.daggerVersion is a property on my base build file. You can replace for whatever version or gradle dependency you desire and are missing.

提交回复
热议问题