title: java.lang.reflect.InvocationTargetException (no error message) for task ':app:kaptDebugKotlin'
body: <p>i ran into following error an cannot find an solution.</p>
  <pre><code>Execution failed for task ':app:kaptDebugKotlin'.
  &gt; A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
     &gt; java.lang.reflect.InvocationTargetException (no error message)
  </code></pre>
  <p>I cannot say, what I have done last time, probably there is some library causing this error which i had updated.
  <a href="https://i.stack.imgur.com/GTwVl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GTwVl.png" alt="Build Gradle" /></a></p>
  <pre><code>plugins {
      id 'com.android.application'
      id 'kotlin-android'
      id 'kotlin-parcelize'
      id 'kotlin-kapt'
      id 'dagger.hilt.android.plugin'
      id 'androidx.navigation.safeargs.kotlin'
  }
  
  android {
      compileSdkVersion rootProject.compileSdkVersion
      buildToolsVersion &quot;30.0.3&quot;
  
      defaultConfig {
          applicationId &quot;com.padder.application&quot;
          minSdkVersion rootProject.minSdkVersion
          targetSdkVersion rootProject.targetSdkVersion
          versionCode 1
          versionName &quot;1.0&quot;
  
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
  
      buildFeatures {
          viewBinding true
      }
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  
      kotlinOptions {
          jvmTarget = '1.8'
          freeCompilerArgs += &quot;-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi&quot;
      }
  }
  
  dependencies {
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion&quot;
      implementation &quot;androidx.core:core-ktx:$ktxVersion&quot;
      implementation &quot;androidx.appcompat:appcompat:$appCompatVersion&quot;
      implementation &quot;com.google.android.material:material:$materialVersion&quot;
      implementation &quot;androidx.constraintlayout:constraintlayout:$constraintLayoutVersion&quot;
      testImplementation &quot;junit:junit:$junitVersion&quot;
      androidTestImplementation &quot;androidx.test.ext:junit:$testExtJunitVersion&quot;
      androidTestImplementation &quot;androidx.test.espresso:espresso-core:$espressoVersion&quot;
  
      // Fragment
      implementation &quot;androidx.fragment:fragment-ktx:$fragmentVersion&quot;
  
      // Navigation Component
      implementation &quot;androidx.navigation:navigation-fragment-ktx:$navigationVersion&quot;
      implementation &quot;androidx.navigation:navigation-ui-ktx:$navigationVersion&quot;
  
      // Lifecycle + ViewModel &amp; LiveData
      implementation &quot;androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion&quot;
      implementation &quot;androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion&quot;
      implementation &quot;android.arch.lifecycle:common-java8:$lifecycleVersion&quot;
  
      // Coroutines
      implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion&quot;
      implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion&quot;
  
      // DataStore
      implementation &quot;androidx.datastore:datastore-preferences:$dataStoreVersion&quot;
  
      // Room
      implementation &quot;androidx.room:room-runtime:$roomVersion&quot;
      kapt &quot;androidx.room:room-compiler:$roomVersion&quot;
      implementation &quot;androidx.room:room-ktx:$roomVersion&quot;
  
      // Dagger Hilt
      implementation &quot;com.google.dagger:hilt-android:$hiltVersion&quot;
      kapt &quot;com.google.dagger:hilt-android-compiler:$hiltVersion&quot;
      implementation &quot;androidx.hilt:hilt-lifecycle-viewmodel:$hiltAndroidXVersion&quot;
      kapt &quot;androidx.hilt:hilt-compiler:$hiltAndroidXVersion&quot;
  }
  
  kapt {
      correctErrorTypes true
  }
  </code></pre>
  <p>These are my librarys + versions. Hopefully this helps. I give you the full error log as well, so you have, what I have.</p>
  <pre><code>Executing tasks: [:app:assembleDebug] in project C:\Users\Nutzer\Desktop\IntelliJ_Projects\Application
  
  &gt; Task :app:preBuild UP-TO-DATE
  &gt; Task :app:preDebugBuild UP-TO-DATE
  &gt; Task :app:compileDebugAidl NO-SOURCE
  [TASKS]
  &gt; Task :app:stripDebugDebugSymbols NO-SOURCE
  &gt; Task :app:validateSigningDebug UP-TO-DATE           ^
  &gt; Task :app:kaptDebugKotlin FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:kaptDebugKotlin'.
  &gt; A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
     &gt; java.lang.reflect.InvocationTargetException (no error message)
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 28s
  21 actionable tasks: 2 executed, 19 up-to-date
  </code></pre>
  <p>Because inside the error is the Database mentioned, I give it as well.</p>
  <pre class="lang-kotlin prettyprint-override"><code>package com.padder.application.data
  
  import androidx.room.Database
  import androidx.room.RoomDatabase
  import javax.inject.Inject
  
  @Database(entities = [Table1::class , Table2::class], version = 1) //exportSchema = false  is not working
  abstract class Database : RoomDatabase() {
  
      abstract fun dao(): Dao
  }
  </code></pre>
  <p>Just say if you need more snippeds, but hopefully these arent to much snippets that you not run away.</p>
  <p>As wished here is the Dao I use:</p>
  <pre class="lang-kotlin prettyprint-override"><code>package com.padder.application.data
  
  import androidx.room.*
  import kotlinx.coroutines.flow.Flow
  
  @Dao
  interface Dao {
      /**
       * SQL-Sort
       */
      @Insert(onConflict = OnConflictStrategy.REPLACE)
      suspend fun insert(item: Item)
  
      @Update
      suspend fun update(item: item)
  
      @Delete
      suspend fun delete(item: Item)
  
      // Searchqueries LIST-Fragment
      fun getItemList(sortState: SortSpinnerState, item: String, search: String) : Flow&lt;List&lt;Item&gt;&gt; =
          when (sortState) {
              SortSpinnerState.BY_NAME -&gt; getItemListSortName(item, search)
              SortSpinnerState.BY_TASTE -&gt; getItemListSortTaste(item, search)
              SortSpinnerState.BY_FAV -&gt; getItemListSortFav(item, search)
              SortSpinnerState.BY_LIKE -&gt; getItemListSortLike(item, search)
          }
  
      @Query(&quot;SELECT nr, name, taste, marke, mag, fav FROM tabak WHERE marke = :marke AND name LIKE '%' || :search || '%' ORDER BY name ASC&quot;)
      fun getItemListSortName(marke: String, search: String): Flow&lt;List&lt;Item&gt;&gt;
  
      @Query(&quot;SELECT nr, name, taste, marke, mag, fav FROM tabak WHERE marke = :marke AND name LIKE '%' || :search || '%' ORDER BY taste ASC&quot;)
      fun getItemListSortTaste(marke: String, search: String): Flow&lt;List&lt;Item&gt;&gt;
  
      @Query(&quot;SELECT nr, name, taste, marke, mag, fav FROM tabak WHERE marke = :marke AND name LIKE '%' || :search || '%' ORDER BY fav = 1 DESC, name ASC&quot;)
      fun getItemListSortFav(marke: String, search: String): Flow&lt;List&lt;Item&gt;&gt;
  
      @Query(&quot;SELECT nr, name, taste, marke, mag, fav FROM tabak WHERE marke = :marke AND name LIKE '%' || :search || '%' ORDER BY like = 1 DESC, like = 2 DESC, like = 3 ASC, name ASC&quot;)
      fun getItemListSortLike(marke: String, search: String): Flow&lt;List&lt;Item&gt;&gt;
  
      // Searchqueries HOME-Fragment
      fun getItemListHome(state: SearchByState, search: String) : Flow&lt;List&lt;Item&gt;&gt; =
          when (state) {
              SearchByState.BY_NAME -&gt; getItemListHomeName(search)
              SearchByState.BY_TASTE -&gt; getItemListHomeTaste(search)
              SearchByState.NO_SEARCH -&gt; getItemListHomeNone()
          }
  
      @Query(&quot;SELECT nr, name, taste, marke, mag, fav FROM tabak WHERE name LIKE '%' || :search || '%' ORDER BY name ASC&quot;)
      fun getItemListHomeName(search: String): Flow&lt;List&lt;Item&gt;&gt;
  
      @Query(&quot;SELECT nr, name, taste, marke, mag, fav FROM tabak WHERE geschmack LIKE '%' || :search || '%' ORDER BY taste ASC&quot;)
      fun getItemListHomeTaste(search: String): Flow&lt;List&lt;Item&gt;&gt;
  
      @Query(&quot;SELECT nr, name, taste, marke, mag, fav FROM tabak WHERE nr = 0 ORDER BY taste ASC&quot;)
      fun getItemListHomeNone(): Flow&lt;List&lt;Item&gt;&gt;
  
      /**
       * SQL-Marke
       */
      @Insert(onConflict = OnConflictStrategy.REPLACE)
      suspend fun insert(marke: Marke)
  
      @Update
      suspend fun update(marke: Marke)
  
      @Delete
      suspend fun delete(marke: Marke)
  
      @Query(&quot;SELECT marke FROM marke ORDER BY nr&quot;)
      suspend fun getMarkeListe(): List&lt;String&gt;
  
      @Query(&quot;SELECT nr FROM marke WHERE marke = :marke&quot;)
      suspend fun getMarkeNr(marke: String): Int
  }
  </code></pre>
  <p>So my question. Can you help me to get rid of this error? What did I just do wrong, or what can I do to handle it.<br />
  Thank you!</p>