Status Update
Comments
ja...@gmail.com <ja...@gmail.com> #2
For Kotlin 2.0 and KSP 2.0 the Cannot change attributes of configuration ':composeApp:debugFrameworkIosX64' after it has been locked for mutation
really seems like a KSP issue. You should file a bug in their repository with a sample app if possible.
If you downgrade to Kotlin 1.9 then things 'should' work, there are example apps out there with such configuration, like the following one:
de...@gmail.com <de...@gmail.com> #3
Will try to use the example provided by you to check if it fixes the issue.
de...@gmail.com <de...@gmail.com> #4
Note that this issue happens when applying the Compose, KSP and Room Plugin together in Kotlin 2.0.x, the workaround for now is to not use the Room Gradle Plugin and instead specify the schema location vis KSP arguments:
// In the build.gradle
ksp {
arg("room.schemaLocation", "${projectDir}/schemas")
}
ho...@gmail.com <ho...@gmail.com> #5
Hi, I encountered a similar problem and was able to resolve it by updating the dependencies
room = "2.7.0-alpha08"
ksp = "2.0.20-1.0.25"
compose-plugin = "1.6.11"
kotlin = "2.0.20"
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: