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.

Migration from 2.7 to 2.8 - Subcomponent scopes

See original GitHub issue

I have a issue with subcomponent’s scopes when I try to upgrade from 2.7 to 2.8.0. Here’s my architecture:

Global App component

@PerApp
@Component(modules = {AppModule.class, DataModule.class, NetworkModule.class})
public interface AppComponent {
    ActivityComponent with(ActivityModule activityModule);
}

Default Activity subcomponent

@PerActivity
@Subcomponent(modules = {ActivityModule.class})
public interface ActivityComponent {
    PinComponent with(PinModule pinModule);
    void inject(LoginActivity loginActivity);
    void inject(MainActivity mainActivity);
    //...
}

Subcomponent for a specific activity

@PerActivity
@Subcomponent(modules = {PinModule.class})
public interface PinComponent {
    void inject(PinActivity pinActivity);
}

@Module
public class PinModule {
    //...
    @PerActivity
    @Provides
    PinItem provideMethods();
    //...
}

This structure works perfectly on 2.7, but on 2.8 it returns compilation error:

Error:(12, 8) error: [package.PinComponent] package.PinComponent has conflicting scopes:

package.ActivityComponent also has @package.PerActivity

If I’m understanding this correctly, I would have to provide a separate scope annotation for PinComponent?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
ronshapirocommented, Jan 31, 2017

Please discuss this on another forum, like stackoverflow, which is better suited for questions.

1reaction
rafakobcommented, Jan 31, 2017

@Kiran89kumar I did, you have to create a seperate annotation for that component.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dagger Component has conflicting scopes - Stack Overflow
The solution to both errors is to give the subcomponent a different scope than the parent, or don't use a subcomponent at all...
Read more >
Play 2.7 Migration Guide - Documentation
This is a guide for migrating from Play 2.6 to Play 2.7. If you need to migrate from an earlier version of Play...
Read more >
Supported Versions and Interoperability for Confluent Platform
All services included in Confluent Platform are supported, including Apache Kafka® and its subcomponents: Kafka brokers, Apache ZooKeeper™, Java and Scala ...
Read more >
HL7 Version 2.8.2 Chapter 2
The scope of HL7 is restricted to the specification of messages between application/ systems and the events triggering them.
Read more >
Migrating 3scale Red Hat 3scale API Management 2.8
Red Hat Ecosystem Catalog · Migrating 3scale · Preface · 1. 3scale template-based upgrade guide: from 2.7 to 2.8 Expand section "1. ·...
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