Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding kapt to use Room causes compile errors

I added apply plugin: 'kotlin-kapt' to be able to use Rooms annotation proccessor:

compile "android.arch.persistence.room:runtime:1.0.0"
kapt "android.arch.persistence.room:compiler:1.0.0"

However when I build my project I get:

Folder C:\Users\...\app\build\generated\source\kaptKotlin\debug


Folder C:\Users\...\app\build\generated\source\kaptKotlin\release


3rd-party Gradle plug-ins may be the cause

If I get rid of kapt and simply use annotationProcessor instead. The app crashes saying:

java.lang.RuntimeException: cannot find implementation for com.example..data.database.Appdatabase. Appdatabase_Impl does not exist

Any ideas on how to use Room

like image 321
Derek Avatar asked Mar 29 '18 17:03

Derek


1 Answers

I was facing similar issue.

Go to:

Run -> Edit Configurations -> General

At the bottom, there is window named

Before launch: Gradle-Aware, Active tool window

Remove

Instant App Provision

and keep Gradle-aware Make

like image 192
Amrita Avatar answered Nov 02 '22 05:11

Amrita