All of sudden I start getting this error, and I am not getting idea why if anyone just let me know where this error is, will be enough helpful. As much I am able to get is t
Maybe I am a bit late for the answer but, anyways, I was getting the same error. The build failure can be caused by some error that Android Studio fails to point out probably due the the project size being very large.
Here is the easy way to point out the exact error.
In Android studio go to Analyze menu and click on Inspect Code; check whole project, click OK and wait for the inspection to finish.
Now you will see a tab that will point all the errors, warnings etc and you can now resolve the real issue.
For me, a bunch of reference errors and an error in the XML expressions with DataBinding
produced this error.
I have deleted a <variable/>
in a layout
file, because I thought, I don't need it anymore. I forgot that I had the variable referenced in the layout
file.
After building the project, this produced an error, where it was not possible to import the BindingImpl
class, because it does not exist and this error was only shown as a warning parallel to the above KaptExecution
error.
After searching for a while, I found this error and resolved it. Then, a bunch of reference errors where shown, because I renamed something and it did not rename it in the Fragment
files. After resolving these errors too, the build finished for me without errors or warnings.
in my case, I have added this line
android {
.
.
.
kapt.includeCompileClasspath = false
}
Change
implementation "android.arch.persistence.room:runtime:1.1.1"
kapt "android.arch.persistence.room:compiler:1.1.1"
To
implementation "androidx.room:room-runtime:2.2.5"
kapt "androidx.room:room-compiler:2.2.5"
I just had this happen to me. Another dev had not completed a merge properly so this line was in the code
<<<<<<< HEAD
Instead of getting a compile error I got the KaptExecution error.
Android Studio's UI was just hiding the error...
when the error occurred, it highlighted the item in the list view, and showed an unhelpful message in the terminal view.
to find the real error, select the root item in the list view so that Android Studio would display the whole build output in the terminal view, then scroll to find error.