Skip to content Skip to sidebar Skip to footer

After Adding Kapt Plugin - A Failure Occurred While Executing Org.jetbrains.kotlin.gradle.internal.kaptexecution

First of all, I'm pretty much aware that a lot of questions on this error had been posted already here, and none of them seems to be having a proper solution especially the one I n

Solution 1:

Replacing

kapt "android.arch.persistence.room:compiler:$room_version"

by

implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"

might fix it as well.

Solution 2:

I had the same problem. I forgot to add @Dao annotation in my room database

Solution 3:

After a week's struggle, I finally found the issue.

I added the kotlin-kapt plugin for realm.

And I had a folder named interface itself to hold some interfaces.

I implemented one of the interfaces from the interface folder in MainActivity.

Now the import for the interface was something like this,

import com.android.app.java.interface.Listener

Where, the keyword interface confused the annotation processor, hence caused error while generating stub.

I renamed the folder (from interface to intrface).

That solved the error.

This is a very simple mistake that cost me a week.

Anyway, found the issue. Yay!

Solution 4:

I had the same problem because i had forgotten to add a converter in a list included in entity..In room you have to add converters in order to store lists in databas

Solution 5:

I had a similar issue and spent forever trying to find the issue. I found another thread that you can run Analyze -> Inspect Code to find the issue, but this didn't work for me and showed nothing, but apparently others had success with this.

My issue ended up being with my database (I was using Room) and the fix was simply a matter of removing a "suspend" I had on an insert function in my DAO..

I found this issue by looking in the java generated code folder. Look at all your database files that are generated with "_Impl". The error was highlighted in red and then I could deduce from here what was going wrong (although I don't know why Android Studio couldn't just show me that error in the build output :/ )

Best of luck though! Those kapt errors are the worst

Post a Comment for "After Adding Kapt Plugin - A Failure Occurred While Executing Org.jetbrains.kotlin.gradle.internal.kaptexecution"