Reputation: 178
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?
Upvotes: 0
Views: 4165
Reputation: 687
This may not be directly related to what the original poster was looking for but posting this answer for anyone looking to solve a similar error. If you have converted some of your classes to Kotlin then use kapt
instead of annotationProcessor
in your build.gradle. It is kind of obvious looking back but took me a while to figure out why I'm getting the sysmbol not found
error with DaggerAppComponenent without any other details.
Upvotes: 2
Reputation: 364
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'
Upvotes: 4