Cycles between @Module.subcomponents and @Subcomponent.modules
See original GitHub issueTrying 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:
- Basically following the website documentation for setting up activity injection, and creating my own version of fragment injection (basically the same thing, but not for injecting fragments but something similar)
Issue Analytics
- State:
- Created 7 years ago
- Comments:9
Top Results From Across the Web
Subcomponents - Dagger
Subcomponents are components that inherit and extend the object graph of a parent component. You can use them to partition your application's object...
Read more >Dagger 2. Part II. Custom scopes, Component dependencies ...
Subcomponent has access to all parents objects. Subcomponent can only have one parent. Surely Subcomponents have differences from Component ...
Read more >Dagger 2 Subcomponent: through module or component ...
Dagger 2 provides subcomponent feature. There are 2 ways we could create subcomponent. I'll be comparing them side by side Of course you ......
Read more >Dagger 2 Adding a subcomponent to a parent component
subcomponents, i read documentation that saids: "Using Module.subcomponents is better since it allows Dagger to detect if the subcomponent is ...
Read more >Dependency Injection with Dagger 2 - CodePath Cliffnotes
Using subcomponents is another way to extend the object graph of a component. Like components with dependencies, subcomponents have their own life-cycle and...
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
Reopening this so that we can make sure to have better reporting around cycles like this
Thanks for posting that example. It seems that you have a cycle:
MainModule
hassubcomponents = MainComponent.class
andMainComponent
hasmodules = MainModule.class
.