question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cycles between @Module.subcomponents and @Subcomponent.modules

See original GitHub issue

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:

  • 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:closed
  • Created 7 years ago
  • Comments:9

github_iconTop GitHub Comments

5reactions
ronshapirocommented, Mar 8, 2017

Reopening this so that we can make sure to have better reporting around cycles like this

2reactions
ronshapirocommented, Mar 7, 2017

Thanks for posting that example. It seems that you have a cycle: MainModule has subcomponents = MainComponent.class and MainComponent has modules = MainModule.class.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found