Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Kotlin - Room Local Storage, build error "A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution"

[Using Gradle 4.0.0], I try to implement local storage by room in Android Kotlin in Andriod Studio 4. When I try to build project, i meet an error in build console

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

Image:

enter image description here

Gradle:

apply plugin: 'kotlin-kapt'

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

Please kindly help to show the solution for me

like image 984
Bong Channarith Avatar asked Jun 11 '20 18:06

Bong Channarith


2 Answers

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. bad bad

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. good good

like image 196
Eric Avatar answered Sep 23 '22 13:09

Eric


The error is show by the kapt in your project, and to show full error message you will have to add these to your gradle.properties file.

kapt.use.worker.api=false
kapt.incremental.apt=false

After that run your app again, and try to read from the detailed error.

kapt error image

like image 21
Sreekant Shenoy Avatar answered Sep 25 '22 13:09

Sreekant Shenoy