Trying to incorporate the new android tooling in the RC, get this now:
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.StackOverflowError
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:303)
at com.sun.tools.javac.model.AnnotationProxyMaker.generateAnnotation(AnnotationProxyMaker.java:89)
at com.sun.tools.javac.model.AnnotationProxyMaker.generateAnnotation(AnnotationProxyMaker.java:81)
at com.sun.tools.javac.code.AnnoConstruct.getAnnotation(AnnoConstruct.java:185)
at dagger.internal.codegen.MapKeys.unwrapValue(MapKeys.java:76)
at dagger.internal.codegen.Key$Factory.mapKeyType(Key.java:495)
at dagger.internal.codegen.Key$Factory.bindingMethodKeyType(Key.java:468)
at dagger.internal.codegen.Key$Factory.forBindingMethod(Key.java:421)
at dagger.internal.codegen.Key$Factory.forBindsMethod(Key.java:385)
at dagger.internal.codegen.DelegateDeclaration$Factory.create(DelegateDeclaration.java:73)
at dagger.internal.codegen.ModuleDescriptor$Factory.create(ModuleDescriptor.java:175)
at dagger.internal.codegen.ComponentDescriptor$Factory.create(ComponentDescriptor.java:502)
at dagger.internal.codegen.ComponentDescriptor$Factory.create(ComponentDescriptor.java:519)
at
.......
I can't share a reproducible case at the moment, but some context around what I was doing:
Considering that you're using a customized setup, and the error seems to imply it is caused by it.
I would assume no one will be able to help you without at least posting the custom code you're using.
Was this same setup working on rc1?
It's also an RC build, where the previous one's android artifact was hosed, so I don't think it hurts to surface feedback sooner rather than later in case it looks relevant to recent changes.
I can't share the case here, publicly, but I've also contacted @ronshapiro separately about adding someone onto the private project to peek at the code.
Definitely appreciate you filing the issue. From the looks of it so far, this appears to be either a javac issue, or a previous bug in the dagger compiler that was exposed now. @hzsweers can you try to peel off a few layers and see if we can get something close to a reproducible bug, even if you don't know what's going on?
Here are a few guesses:
@Binds method. is your @MapKey in a different compilation unit, and if so, does it have at least @Retention(CLASS) or RUNTIME? @MapKey? Is it possible it's malformed?If you patch the Dagger compiler, you could pretty easily print out the method that this is failing on and that will give a lot more clues (unless you already know which one it is).
Are you seeing this error 100% of the time? I presume this is with your Buck setup?
It's not super clear to me where this is actually stack-overflowing. Do you see the repetition in part of the stack trace you didn't post?
Will do on the points. To touch on the others -
this is actually just vanilla gradle, happens with error prone on and off. Single module
This is the line that overflows, sorry I cut it off a bit too soon:
at dagger.internal.codegen.ComponentDescriptor$Factory.create(ComponentDescriptor.java:519)
I've experienced this as well. Here's an example project which reproduces the issue:
Thanks for posting that example. It seems that you have a cycle: MainModule has subcomponents = MainComponent.class and MainComponent has modules = MainModule.class.
D'oh! Thanks.
Yep same issue for me!
Reopening this so that we can make sure to have better reporting around cycles like this
Most helpful comment
Reopening this so that we can make sure to have better reporting around cycles like this