title: memory leaks: Empty Android project + Dagger2 + LeakCanary
body: <p>Faced such a problem. 
  I create a new project with Empty Activity, and add the dependencies of the project, dagger2 and leakcanary. 
  Run the application, then close and the leakcanary displays a memory leak.</p>
  
  <p>Add dependencies</p>
  
  <pre><code>android {
      compileSdkVersion 26
      buildToolsVersion '26.0.3'
      defaultConfig {
          applicationId "xxxxx"
          minSdkVersion 16
          targetSdkVersion 26
          versionCode 1
          versionName "1.0"
      }
  }
  //Dagger
  implementation "com.google.dagger:dagger:2.14.1"
  kapt "com.google.dagger:dagger-compiler:2.14.1"
  //Debug
  debugImplementation "com.squareup.leakcanary:leakcanary-android:1.5.4"
  </code></pre>
  
  <p>Create appkication class and init leakcanary</p>
  
  <pre><code>class AppDelegate: Application() {
  
      override fun onCreate() {
          super.onCreate()
          onApplicationCreate()
          initDagger(this)
      }
  
      private fun initDagger(app: Application): AppComponent =
              DaggerAppComponent.builder()
                      .appModule(AppModule(app))
                      .dataModule(DataModule())
                      .build()
  
      private fun onApplicationCreate() {
          if (BuildConfig.DEBUG) {
              if (LeakCanary.isInAnalyzerProcess(this)) {
                  return
              }
              LeakCanary.install(this)
          }
      }
  }
  </code></pre>
  
  <p>MainActivity class</p>
  
  <pre><code>class MainActivity : Activity() {
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
      }
  }
  </code></pre>
  
  <p>Create dagger component</p>
  
  <pre><code>@Singleton
  @Component(modules = arrayOf(AppModule::class, DataModule::class))
  interface AppComponent {
  }
  
  @Module
  class AppModule(private val appContext: Application) {
  
      @Provides
      fun provideContext() = appContext
  }
  
  @Module
  class DataModule {
  }
  </code></pre>
  
  <p>Here is what leakcanary shows <a href="https://i.stack.imgur.com/PYJql.png" rel="nofollow noreferrer">screen</a></p>
  
  <p>If the dependence of the dagger2 is removed, then there is no leakage.
  What am I doing wrong?</p>