title: Failed for task ':app:kaptGenerateStubsDebugKotlin' after adding Room's @Database to database abstract class
body: <p>I am trying to implement Room into Android application written in Kotlin. After build failing so many times, I pinpointed the problem that it failed when I added @Database into my database class.</p>
  
  <pre><code>package sample.service.local
  
  import android.arch.persistence.room.Database
  import android.arch.persistence.room.RoomDatabase
  import sample.service.model.Announcement
  
  @Database(entities = [Announcement::class], version = 1)
  abstract class AnnounceDatabase: RoomDatabase() {
      abstract fun announceDAO(): AnnounceDAO
  }
  </code></pre>
  
  <p>If I commented out the line with @Database it built successfully. Its DAO and Entity files shouldn't be the problem as I tried building with them without @Database and it was successful. I also haven't added them into any other classes; I just created 3 new files which are this database, its dao, and its entity.</p>
  
  <p>Here's build.gradle(Module:app)</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  apply plugin: 'kotlin-android'
  
  apply plugin: 'kotlin-android-extensions'
  apply plugin: "kotlin-kapt"
  
  android {
      compileSdkVersion 27
      defaultConfig {
          applicationId "sample"
          minSdkVersion 16
          targetSdkVersion 27
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
          vectorDrawables.useSupportLibrary = true
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      dataBinding {
          dataBinding.enabled true
      }
  }
  
  project.ext {
      supportLibraryVersion = "26.1.0"
      daggerVersion = "2.13"
      butterKnifeVersion = "8.8.1"
      rxJavaVersion = "2.1.0"
      rxAndroidVersion = "2.0.1"
      lifecycleVersion = "1.0.0"
      roomVersion = "1.0.0"
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
      implementation 'com.android.support:appcompat-v7:27.1.0'
      implementation 'com.google.android.gms:play-services-maps:11.8.0'
      implementation 'com.android.support:support-v4:27.1.0'
      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'
  
  // Android Support Library
  implementation 'com.android.support:design:27.1.0'
  implementation 'com.google.android.gms:play-services-location:11.8.0'
  implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  implementation 'com.android.support:cardview-v7:27.1.0'
  implementation 'com.android.support:recyclerview-v7:27.1.0'
  implementation 'com.android.support:support-annotations:27.1.0'
  implementation 'com.android.support:support-compat:27.1.0'
  implementation 'com.android.support:support-core-ui:27.1.0'
  
  // Easy Permission
  implementation 'pub.devrel:easypermissions:1.2.0'
  
  // Lifecycle
  implementation "android.arch.lifecycle:extensions:1.1.0"
  annotationProcessor "android.arch.lifecycle:compiler:1.1.0"
  
  // Kotlin binding
  //    kapt 'com.android.databinding:compiler:3.1.0'
  
  // Dagger core
  kapt "com.google.dagger:dagger-compiler:$project.daggerVersion"
  implementation "com.google.dagger:dagger:$project.daggerVersion"
  
  // Dagger Android
  kapt "com.google.dagger:dagger-android-processor:$project.daggerVersion"
  implementation "com.google.dagger:dagger-android-support:$project.daggerVersion"
  
  // Timber
  implementation 'com.jakewharton.timber:timber:4.6.0'
  
  // Simple Item Decoration
  implementation 'com.bignerdranch.android:simple-item-decoration:1.0.0'
  
  // Retrofit
  implementation "com.squareup.retrofit2:retrofit:2.1.0"
  implementation "com.squareup.retrofit2:converter-gson:2.1.0"
  implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
  //    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
  
  // RxJava &amp; RxAndroid
  implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
  implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
  
  // PageIndicatorView
  implementation 'com.romandanylyk:pageindicatorview:1.0.0@aar'
  
  // Room
  implementation "android.arch.persistence.room:rxjava2:$project.roomVersion"
  implementation "android.arch.persistence.room:runtime:$project.roomVersion"
  kapt "android.arch.persistence.room:compiler:$project.roomVersion"
  testImplementation "android.arch.persistence.room:testing:$project.roomVersion"
  }
  </code></pre>
  
  <p>Here's project's gradle</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
  ext.kotlin_version = '1.2.31'
  repositories {
      google()
      jcenter()
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:3.1.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
  }
  }
  
  allprojects {
  repositories {
      google()
      jcenter()
  }
  }
  
  task clean(type: Delete) {
  delete rootProject.buildDir
  }
  </code></pre>
  
  <p>I ran <code>gradlew clean build --stacktrace --debug</code> and <a href="https://gist.github.com/NichaRoj/f4ae63deb7a093b16f99255c018936c9" rel="nofollow noreferrer">here's error message</a></p>
  
  <p>Any help will be appreciated.</p>