9

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

Derek
  • 196
  • 1
  • 12

2 Answers2

1

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

Nemo
  • 2,441
  • 2
  • 29
  • 63
Amrita
  • 455
  • 4
  • 12
0

I delete two folder app\build\generated\source\kaptKotlin\debug and app\build\generated\source\kaptKotlin\release ("debug" and "release") and add in gradle:

kapt {
        mapDiagnosticLocations = true
    }

then the project is sync without problem.

A Mo
  • 153
  • 8