The following options were not recognized by any processor: '[kapt.kotlin.generated, room.incremental]'
This type of problem can occure with a multi-module project that has been added to room. For such a project the problem was caused by adding the RoomDatabase derived class to a library module, but configuring the build.gradle of app module.
The solution is to configure the build.gradle of the module that contains the RoomDatabase derived class.
- In the build.gradle file in the dependencies{} section add the dependency for the room compiler.
kapt "android.arch.persistence.room:compiler:$room_version"
Note that for java based project use below code
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
While I agree that missing kapt in module was the original problem in IDE.
- "androidx.room:room-compiler:${roomVersion}"
There can be other one in CLI, which you can see with verbose warnings:
Current JDK version 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12 has a bug (https://bugs.openjdk.java.net/browse/JDK-8007720) that prevents Room from being incremental. Consider using JDK 11+ or the embedded JDK shipped with Android Studio 3.5+.warning: The following options were not recognized by any processor: '[kapt.kotlin.generated, room.incremental]'[WARN] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: androidx.room.RoomProcessor (DYNAMIC).