Status Update
Comments
ja...@gmail.com <ja...@gmail.com> #2
There is no error when I use kotlin versions: 1.6.21, but issue/error starts appearing when kotlin version is 1.7.0
de...@gmail.com <de...@gmail.com> #3
de...@gmail.com <de...@gmail.com> #4
ho...@gmail.com <ho...@gmail.com> #5
da...@google.com <da...@google.com> #6
Thanks for the report I was able to reproduce the issue and indeed it occurs when using Kotlin 1.7.0. Sadly I don't have a workaround yet, but will investigate further.
da...@google.com <da...@google.com> #7
and just to clarify, we see the issue when using Room 2.4.2, but not with Room 2.5.0-alpha02.
yy...@gmail.com <yy...@gmail.com> #8
ma...@gmail.com <ma...@gmail.com> #9
I updated everything - It wasn't running.
With ext.kotlin_version = "1.6.21" - it is running.
za...@gotocme.com <za...@gotocme.com> #10
da...@google.com <da...@google.com> #11
Hey all, looks like the issue is related to a change in Kotlin's @Metadata
annotation and the way Room reads it, Room 2.4.2 is using an older version of the kotlinx-metadata-jvm
library which does not support reading Kotlin 1.7 information, where as in Room 2.5.0 we updated the library.
To workaround this issue please force upgrade the dependency by adding it to your annotation processor path, i.e. add kapt "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.5.0"
if you are using Room 2.4.x.
Meanwhile, I'll work on releasing a Room 2.4.3 that is compatible with Kotlin 1.7 since Room 2.5.x is still in development.
si...@gmail.com <si...@gmail.com> #12
zs...@gmail.com <zs...@gmail.com> #13
Thanks! Do you think 2.4.3
is something that will be released in the next couple weeks? Trying to decide if I want to use the workaround or just wait until it is released.
da...@google.com <da...@google.com> #14
ge...@gmail.com <ge...@gmail.com> #15
da...@google.com <da...@google.com>
19...@gmail.com <19...@gmail.com> #16
pi...@gmail.com <pi...@gmail.com> #17
Maybe reopen this.
@Query("SELECT * FROM ${SetupData.TABLE_NAME}")
suspend fun selectAll(): Cursor
[ksp] SetupDataDao.kt:24: Not sure how to convert a Cursor to this method's return type (android.database.Cursor).
Duh!
- Room 2.5.2
- Kotlin 1.9
- KSP 1.9.0-1.0.11
te...@gmail.com <te...@gmail.com> #18
da...@google.com <da...@google.com> #19
The diagnosis is the same, Room needs to update its kotlinx-metadata-jvm dependency to be able to read Kotlin 1.9+ metadata. An upcoming patch release (Room 2.5.3) will have the dep updated.
da...@google.com <da...@google.com> #20
Alternative if you use the KSP version of Room, this shouldn't be an issue.
io...@gmail.com <io...@gmail.com> #21
ri...@gmail.com <ri...@gmail.com> #22
bl...@gmail.com <bl...@gmail.com> #23
da...@davwheat.dev <da...@davwheat.dev> #24
ra...@gmail.com <ra...@gmail.com> #25
ma...@gmail.com <ma...@gmail.com> #26
sh...@navi.com <sh...@navi.com> #27
rc has been out since 20th sept
mr...@gmail.com <mr...@gmail.com> #28
pa...@gmail.com <pa...@gmail.com> #29
ah...@gmail.com <ah...@gmail.com> #30
Upgraded room to version to 2.6.1 and the issue is resolved!
ni...@gmail.com <ni...@gmail.com> #31
Issue is still present if you want to return Cursor
Room 2.7.0-alpha12 kotlinVersion = "2.1.0" kspVersion = "2.1.0-1.0.29"
Sample: @Query("SELECT * FROM ${SetupData.TABLE_NAME}") suspend fun selectAll(): Cursor [ksp] Not sure how to convert a Cursor to this method's return type (android.database.Cursor).
Description
Component used: Room with suspend functions i.e. coroutines
error:
/Users/jayshah/AndroidStudioProjects/SampleMemoryNotes/app/build/tmp/kapt3/stubs/debug/com/example/samplememorynotes/framework/db/NoteDao.java:17: error: Not sure how to convert a Cursor to this method's return type (java.lang.Object). public abstract java.lang.Object getNoteEntity(long id, @org.jetbrains.annotations.NotNull()
Usage:
Version used:
Devices/Android versions reproduced on: Android emulator
If this is a bug in the library, we would appreciate if you could attach: