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.
        at Method)
        at sun.reflect.annotation.AnnotationParser.annotationForMap(
        at dagger.internal.codegen.MapKeys.unwrapValue(
        at dagger.internal.codegen.Key$Factory.mapKeyType(
        at dagger.internal.codegen.Key$Factory.bindingMethodKeyType(
        at dagger.internal.codegen.Key$Factory.forBindingMethod(
        at dagger.internal.codegen.Key$Factory.forBindsMethod(
        at dagger.internal.codegen.DelegateDeclaration$Factory.create(
        at dagger.internal.codegen.ModuleDescriptor$Factory.create(
        at dagger.internal.codegen.ComponentDescriptor$Factory.create(
        at dagger.internal.codegen.ComponentDescriptor$Factory.create(

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

ronshapirocommented, Mar 8, 2017

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

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 Post

No results found

github_iconTop Related Hashnode Post

No results found