Dagger not finding an Autofactory generated class after updating to 2.18
See original GitHub issueI’m running into a strange thing trying to update from Dagger 2.16 to 2.17/18 Dagger fails, complaining an AutoFactory generated class isn’t present.
If I copy the AutoFactory generated implementation into my code and remove the @AutoFactory
annotation, then everything compiles fine. I haven’t found anything that’s obviously different about this class, and I haven’t been able to reproduce it yet. There are three other AutoFactory classes in the same package which work fine once this one is removed.
The Factory class does seem to be generated too, just Dagger doesn’t see it.
The relevant bit of the stack trace when building with 2.18 is
Caused by: java.lang.TypeNotPresentException: Type MyClassFactory not present
at dagger.internal.codegen.DaggerTypes$1.visitError(DaggerTypes.java:181)§
at dagger.internal.codegen.DaggerTypes$1.visitError(DaggerTypes.java:167)
at com.sun.tools.javac.code.Type$ErrorType.accept(Type.java:1855)
at dagger.internal.codegen.DaggerTypes.checkTypePresent(DaggerTypes.java:164)
at dagger.internal.codegen.RequestKinds.getRequestKind(RequestKinds.java:105)
at dagger.internal.codegen.DependencyRequestValidator.validateDependencyRequest(DependencyRequestValidator.java:59)
at dagger.internal.codegen.ComponentValidator.lambda$validate$1(ComponentValidator.java:214)
at dagger.internal.codegen.ComponentValidator.validate(ComponentValidator.java:167)
at dagger.internal.codegen.ComponentProcessingStep.processSubcomponents(ComponentProcessingStep.java:210)
at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:121)
at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:45)
at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:330)
at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:181)
at org.gradle.api.internal.tasks.compile.processing.DelegatingProcessor.process(DelegatingProcessor.java:62)
at org.gradle.api.internal.tasks.compile.processing.DynamicProcessor.process(DynamicProcessor.java:51)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1039)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1180)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
at com.sun.tools.javac.main.Main.compile(Main.java:523)
... 63 more
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Dagger2 : Cannot find symbol @Autofactory classes
I want to migrate my project from dagger 1 to dagger 2. after adding dagger 2 dependent libraries i am getting " error:...
Read more >Kapt: Dagger + AutoFactory not working : KT-10352
It seems the reason is that when the annotation processor for Dagger runs, it is not able to find the code generated by...
Read more >Diff - platform/packages/apps/TV - Google Git
DaggerApplication ; /** The base application class for Live TV applications. ... isAudioOnly() when SDK is updated + mAudioOnly = Boolean.
Read more >Assisted Injection and AutoFactory - Google Groups
I think we need to either pull dagger from auto-factory, or migrate to Dagger 2.0 which has no runtime, so we don't pollute...
Read more >@Generated Annotation Using Gradlew + Dagger - ADocLib
When dagger goes to generate the code for the Component builders in ... gradlew build I get error: cannot find symbol @Generated all...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try this in build.gradle:
I believe I have the same issue but not 100% sure - is there an easy way to try out future releases? Any beta releases out there?