When updating to Kotlin 1.7.0, since it's required by the latest version of Jetpack Compose, I found out that Room was no longer working. I was using kapt
as my annotation processor, and the compiler was throwing error messages such as:
[*] error: Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
The fix was to migrate from
kapt
toksp
. KSP is the theoretical successor of kapt, and it's developed by Google. To do so, first I had to import the library into my classpath:Check the latest version from MVN Repository just in case there has been an update, but as the time of writing this the latest version for Kotlin 1.7.0 is
1.7.0-1.0.6
.Now, in my module's
build.gradle
:Now Room should be working correctly in Kotlin 1.7.0!