Error: cannot find symbol class DaggerAppComponent

帅比萌擦擦* 提交于 2019-12-08 11:48:31

问题


I downloaded several sample projects from github that use dagger, e. g. Moxy sample project (trying to run github-sample) but everywhere there is the same error - «cannot find symbol class DaggerAppComponent». I did not make any changes in the projects just downloaded and tried to run them.

Gradle version - 3.1.2 AndroidStudio – 3.3

def dagger = '2.7'
implementation "com.google.dagger:dagger:$dagger"
annotationProcessor "com.google.dagger:dagger-compiler:$dagger"

Does anybody has an idea how to fix it?


回答1:


Adding the below dependency.

implementation 'com.google.dagger:dagger:2.x'

annotationProcessor 'com.google.dagger:dagger-compiler:2.x'

OR try this

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



来源:https://stackoverflow.com/questions/54232041/error-cannot-find-symbol-class-daggerappcomponent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!