title: Error: Unresolved reference: DaggerAppComponent
body: <p>I've been facing this problem for 3 hours. I couldn't find any logical reason to what is happening. The problem is, Only when I use the generated <code>Dagger</code> classes, and after <code>Gradle</code> do the <code>Build</code> every reference to these classes became red and I get the error:<br/></p>
  
  <blockquote>
    <p>Error: Unresolved reference: DaggerAppComponent</p>
  </blockquote>
  
  <p>But, If I comment out every line in the <code>App</code> class reference any of these generated <code>Dagger</code> classes. The build process completed successfully. I tried doing clean/ rebuild/ make project. but it doesn't work.
  Some information about my  environment:<br/>
  <code>Build.gradle</code>:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  apply plugin: 'kotlin-android'
  
  apply plugin: 'kotlin-android-extensions'
  
  android {
      compileSdkVersion 26
      defaultConfig {
          applicationId "xxxxx"
          minSdkVersion 19
          targetSdkVersion 26
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      dataBinding {
          enabled = true
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
  
      implementation "android.arch.lifecycle:extensions:1.1.0"
      implementation "android.arch.lifecycle:viewmodel:1.1.0"
      implementation "android.arch.lifecycle:livedata:1.1.0"
      implementation "android.arch.persistence.room:runtime:1.0.0"
      implementation "android.arch.lifecycle:runtime:1.1.0"
  
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
  
      implementation 'com.android.support:appcompat-v7:26.1.0'
      implementation 'com.android.support:design:26.1.0'
      implementation 'com.android.support.constraint:constraint-layout:1.0.2'
      implementation 'com.android.support:support-v4:26.1.0'
  
  
      kapt "android.arch.lifecycle:compiler:1.1.0"
      kapt "android.arch.persistence.room:compiler:1.0.0"
  
      kapt "com.google.dagger:dagger-compiler:2.8"
      compile "com.google.dagger:dagger:2.8"
      compile "com.google.dagger:dagger-android:2.8"
  
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.1'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  }
  </code></pre>
  
  <p>Kotlin version: <code>ext.kotlin_version = '1.1.51'</code><br/>
  Android Studio version: <code>3.0.1</code></p>
  
  <p>dependencies section in <code>Build.Gradle</code> file for the project (not the app module):</p>
  
  <pre><code>dependencies {
      classpath 'com.android.tools.build:gradle:3.0.1'
      classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  
      // NOTE: Do not place your application dependencies here; they belong
      // in the individual module build.gradle files
  }
  </code></pre>
  
  <p><code>App</code> class:</p>
  
  <pre><code>class App:Application() {
      private val component:AppComponent by lazy {
          DaggerAppComponent.builder()
                  .build()
      }
      override fun onCreate() {
          super.onCreate()
          component.inject(this)
      }
  }
  </code></pre>
  
  <p>If anyone can figure out what is the problem, it would be much appreciated.<br/>
  P.S. I'm still learning <code>Dagger2</code> and I'm new to <code>Kotlin</code> and <code>Native</code> development in general. I came from <code>C#</code> and <code>Xamarin</code> background.</p>