Dagger 2 “Dagger” prefix component not able to compile? auto generated class

前端 未结 8 3786
悲哀的现实
悲哀的现实 2021-02-20 18:44

Im trying to use Dagger 2 on android. I previously had it working and i had an appModule injecting dependencies into specific classes in the app. My Issue is that iam getting th

8条回答
  •  你的背包
    2021-02-20 19:46

    Hope you all doing well. I was facing the same problem and spent a lot of time over stack overflow. At last I go through this and able to find solution. Briefly, You have to make some changes in your module level Gradle file. Please remove

    apply plugin: 'com.neenbedankt.android-apt'

    at the top of the file. And replace

    apt 'com.google.dagger:dagger-compiler:2.11'
    

    with

    annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
    

    After that rebuild your project and you will be able to import your Dagger prefix classes. Hopw it will help you out.

提交回复
热议问题