Execution failed for task ':app:kaptDebugKotlin'.
I had same error I was using below code
implementation "android.arch.persistence.room:runtime:1.1.1"
kapt "android.arch.persistence.room:compiler:1.1.1"
I solved using dependency as below
def room_version = "2.4.1"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"
Execution failed for task ':app:kaptDebugKotlin' - Error Occurs while using Hilt
So, it appears there is an issue integrating Hilt while targeting version 31 (Android 12).
When I had:
compileSdkVersion 31
buildToolsVersion "31.0.0"
defaultConfig {
minSdkVersion 21
targetSdkVersion 31
}
The error appears...
but when I changed to:
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
}
It starts working, without that error..
Something wrong with integrating Hilt while targeting android 12 (likely)
Dagger 2 error Execution failed for task ':app:kaptDebugKotlin'
finally i found that question in stack overflow and work for me, thanks
Cannot find DaggerAppComponent inside Application class
Getting Execution failed for task ':app:kaptDebugKotlin'. when trying to implement Room component
In case if you have not found the answer here you go.
The problem is explained here and has a workaround too.
https://issuetracker.google.com/issues/174695268#comment9
Related Topics
Android: Execute Code in Regular Intervals
Android Sha1 Release Keystore Not Working with Google Maps
How to Create Listview Inside Dialog
Android Studio and Android.Support.V4.App.Fragment: Cannot Resolve Symbol
Android Studio Keyboard Shortcut Control
Play Store Having New Version of The App, But Not Showing Update
Custom Filtering Arrayadapter in Listview
Use 32-Bit Jni Libraries on 64-Bit Android
How to Get Total Ram Size of a Device
Camera Preview Stretched on Few Android Devices
Onactivityresult Do Not Fire If Launch Mode of Activity Is Singleinstance
How to Force Audio Through The Speakers When Headphones Are Plugged In
Switch Back/Front Camera on Fly
Remove Android Default Action Bar
How to Find Android Textview Number of Characters Per Line
How to Execute Background Task When Android App Is Closed/Set to Background