title: Dagger2 Component (un-scoped) cannot depend on scoped components - Error
body: <p>I am trying to compile <a href="https://github.com/svenjacobs/android-dagger2-example" rel="noreferrer">https://github.com/svenjacobs/android-dagger2-example</a>
  but I am running into an error related to unscoped component depending on scoped components.  (Android Studio 1.1, Gradle 2.2.1).  Also if anyone knows of other Dagger2 Android examples WITH FRAGMENTS I would like to know about them.</p>
  
  <p>UPDATE: Here is another example one very basic with fragments:
          <a href="https://github.com/gk5885/dagger-android-sample" rel="noreferrer">https://github.com/gk5885/dagger-android-sample</a></p>
  
  <pre><code>/Users/Mac1/android-dagger2-example-master/app/src/main/java/com/svenjacobs/dagger2/ActivityComponent.java
  Error:(15, 1) error: com.svenjacobs.dagger2.ActivityComponent (unscoped) cannot depend on scoped components:
  @Singleton com.svenjacobs.dagger2.ApplicationComponent
  Error:Execution failed for task ':app:compileDebugJava'.
  &gt; Compilation failed; see the compiler error output for details.
  </code></pre>
  
  <p>Here is the file ActivityComponent which is apparently not scoped:</p>
  
  <pre><code>import dagger.Component;
  
  /**
   * Component for all activities.
   *
   * @author Sven Jacobs
   */
  @Component(dependencies = ApplicationComponent.class,
         modules = {
                 MainActivityModule.class,
                 AModule.class,
                 BModule.class
         })
  interface ActivityComponent extends AFragment.Injector, BFragment.Injector  {
  
      void inject(MainActivity activity);
  
      void inject(AnotherActivity activity);
  }
  </code></pre>
  
  <p>And here is the scoped component:</p>
  
  <pre><code>package com.svenjacobs.dagger2;
  
  import javax.inject.Singleton;
  
  import dagger.Component;
  
  /**
   * Application-wide dependencies.
   *
   * @author Sven Jacobs
   */
  @Singleton
  @Component(modules = ApplicationModule.class)
  interface ApplicationComponent {
  
  void inject(Dagger2Application application);
  
  /**
   * Provides dependency for sub-components
   */
  SomeApplicationDependency someApplicationDependency();
    }
  </code></pre>