title: Dagger 2.11 Dependency Cycle
body: <p>Using Dagger 2.11, the following code returns  "Error:[dagger.android.AndroidInjector.inject(T)] Found a dependency cycle:". This is happening because the provideApp method has the argument "App app". If I remove it and do a dirty hack that provides the application instance directly, the code compiles and works.</p>
  
  <p>From examples I've seen before, it used to be common practice to keep an instance of the application in the module and using that for other providers, but since this module class is now abstract, this doesn't work as the @Provide methods need to be static.</p>
  
  <p>How can I solve this?</p>
  
  <pre><code>@Module(includes = AndroidInjectionModule.class)
  public abstract class AppModule {
  
       @Provides
       @Singleton
       static App provideApp(App app) {
          return app;
       }
  
       @Provides
       static Authenticator provideAuthenticator(App app) {
           return new AuthenticatorImpl(app);
       }
  }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>What I need to achieve is basically this behaviour: </p>
  
  <pre><code>@Module(includes = AndroidInjectionModule.class)
  public class AppModule {
  
      private App application;
  
      AppModule(App app) {
          application = app;
      }
  
      @Provides
      Authenticator provideAuthenticator() {
          return new AuthenticatorImpl(application);
      }
  }
  </code></pre>
  
  <p>However, this doesn't work since the AppModule is now an abstract class and the app wouldn't compile if I use @Provides Authenticator provideAuthenticator() without the static keyword. If I use the static keyword, then I can't access the non-static application field.</p>