A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution

前端 未结 30 1794
南旧
南旧 2020-12-12 20:01

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

相关标签:
30条回答
  • 2020-12-12 20:22

    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.

    1. In Android studio go to Analyze menu and click on Inspect Code; check whole project, click OK and wait for the inspection to finish.

    2. Now you will see a tab that will point all the errors, warnings etc and you can now resolve the real issue.

    0 讨论(0)
  • 2020-12-12 20:22

    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.

    0 讨论(0)
  • 2020-12-12 20:22

    in my case, I have added this line

     android {
        .
        .
        .
    
        kapt.includeCompileClasspath = false
    
     }
    
    0 讨论(0)
  • 2020-12-12 20:23

    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"
    
    0 讨论(0)
  • 2020-12-12 20:24

    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.

    0 讨论(0)
  • 2020-12-12 20:25

    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.

    0 讨论(0)
提交回复
热议问题