I am trying to interact with my application but am encountering the error in the title.
I have followed the answer on: Kotlin Execution failed for task ':app:kaptDebugKotlin'
in using annotationProcessor instead of kapt to get rid of the error:
Kotlin Execution failed for task ':app:kaptDebugKotlin'
But now I am faced with a new error:
Caused by: java.lang.RuntimeException: cannot find implementation for com.example.nutritionapp.database.IngredientDatabase. IngredientDatabase_Impl does not exist
My project level Gradle file is (My Gradle version is 6.0.1):
buildscript {
ext.kotlin_version = '1.4.21'
ext.kotlinVersion = '1.4.21'
ext.navigationVersion = "2.2.0"
repositories {
google()
//jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"
classpath 'com.google.gms:google-services:4.3.10'
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
}
and my app level Gradle file is:
apply plugin: 'kotlin-kapt'
.
.
.
annotationProcessor "androidx.lifecycle:lifecycle-compiler:$2.2.0"
implementation "androidx.lifecycle:lifecycle-extensions:$2.2.0"
implementation "androidx.room:room-ktx:$2.2.5"
implementation "androidx.room:room-runtime:$2.2.5"
annotationProcessor "androidx.room:room-compiler:$2.2.5"
I defined my database as such:
@Database(entities = [IngredientDataClassDTO::class, RecipeNotificationClassDTO::class, RecipeOfDayDTO::class], version = 8, exportSchema = false)
abstract class IngredientDatabase : RoomDatabase()
I do not think I am missing any annotation as my application was working fine before. It was only after adding a new table to my database that the
Kotlin Execution failed for task ':app:kaptDebugKotlin'
error appeared, which I addressed using annotationProcessing instead of kapt but again this gives me the error in the title.
Any suggestions would be appreciated, thank you.