title: Kotlin - Dagger 2 - Component is not generated by Dagger 2 in Android
body: <p>I'm stuck at this problem when I move from java to Kotlin. Dagger is not generating the DaggerComponent class. I've tried many ways to fix this. This is my Code :</p>
  <p><strong>app.gradle</strong> :</p>
  <p>...</p>
  <pre><code>apply plugin: 'kotlin-kapt'
  
  ...
  
  dependencies {
      ...
  
      implementation &quot;com.google.dagger:dagger:$dagger_version&quot;
      implementation &quot;com.google.dagger:dagger-android:$dagger_version&quot;
      implementation &quot;com.google.dagger:dagger-android-support:$dagger_version&quot;
      kapt &quot;com.google.dagger:dagger-compiler:$dagger_version&quot;
      kapt &quot;com.google.dagger:dagger-android-processor:$dagger_version&quot;
      provided 'javax.annotation:jsr250-api:1.0'
  
     ...
  
      compileOnly 'org.glassfish:javax.annotation:10.0-b28'
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version&quot;
  }
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  <p>this is my <strong>project.gradle</strong> :</p>
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      ext.kotlin_version = '1.1.51'
      ext.support_version = '27.1.1'
      ext.glide_version = '4.7.1'
      ext.glide_slider_version = '1.3.2'
      ext.dagger_version = '2.17'
  
      repositories {
          google()
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.0.1'
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
          classpath 'com.google.gms:google-services:4.0.1'
  
         ...
  </code></pre>
  <p>And finally this is my component interface code :</p>
  <pre><code>@Component(modules = arrayOf(AppModule::class, DatabaseModule::class))
  interface DIComponent {
      fun inject(app:App)
  }
  </code></pre>
  <p>I think that i did it correctly, I declare all the required code with the correct annotations. I've did clean and rebuild the project but it still doesn't work. i did the invalidate caches and restart etc. it's still doesn't work.</p>
  <p>Did I make a mistake when declaring the component? Or is there something wrong with my Android Studio. I don't have any idea about this. It's really confusing me and made me stressful.</p>