Avatar ·

KaptExecution error when building Android project with Kotlin: what to do?

Hi everyone! I'm a beginner in Android development with Kotlin, and I encountered a problem when building my project. I'm using Android Studio, a Kotlin project with Room and Dagger Hilt. When I run the build (Build -> Make Project), I get the following error:\n\n```\nA failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution\n```\n\nThe full error log is long, but at the end there's something about "java.lang.reflect.InvocationTargetException" and "no constructor for class ..." or "cannot find symbol".\n\nHere's an example of my `build.gradle.kts` (app-level):\n\n```kotlin\nplugins {\n id("com.android.application")\n id("org.jetbrains.kotlin.android")\n id("kotlin-kapt")\n}\n\nandroid {\n compileSdk = 34\n defaultConfig {\n applicationId = "com.example.myapp"\n minSdk = 24\n```