Error:Execution Failed for Task ':App:Kaptdebugkotlin'

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



Leave a reply



Submit