anyone by chance get KMP version of Jetpack Room w...
# multiplatform
j
anyone by chance get KMP version of Jetpack Room working in a project with Kotlin 2.0.0-RCx?
maybe related to other updates but now getting
Cannot change attributes of configuration ':common:debugFrameworkIosX64' after it has been locked for mutation
- only happens if following included
Copy code
add("kspIosSimulatorArm64",libs.androidx.room.compiler)
add("kspIosX64", libs.androidx.room.compiler)
add("kspIosArm64", libs.androidx.room.compiler)
p
Getting the same , downgraded to 1.9.24
j
Has anyone been able to get KMP version of Jetpack Room working with Kotlin 2.0? (I'm still getting the above error)
v
Yes, Please check out this repo. I have used latest kotlin version
2.0.0
. There are some temp hacks added for now in AppDatabase class otherwise it throws the error.
Copy code
Class 'AppDatabase_Impl' is not abstract and does not implement abstract base class member 'clearAllTables'.
gradle file: https://github.com/cvivek07/KMM-PicSplash/blob/main/composeApp/build.gradle.kts Repo: https://github.com/cvivek07/KMM-PicSplash/
j
Thanks, will take a look
Was talking to some of Google folks at KotlinConf yesterday and they seemed to think there was issue with use of KSP 2
v
Yes, until those issues are fixed, we’d need to add the ksp generated code path in gradle.
👍 1
j
Thanks @Vivek Choudhary, have it working here now as well with your changes
👍 1
e
Hi @Vivek Choudhary, I implement your solution and its syncing successfully. But I cannot run Android app. Room throws an error:
Class 'WordDatabase_Impl' is not abstract and does not implement abstract base class member 'clearAllTables'.
"WordDatabase" is my room db class. But its working on ios somehow. Did you get this error before?
v
Yes. I have added a workaround to fix this. Check the AppDatabase implementation in the above repo.
e
Thanks a lot ❤️
v
Big shoutout to @carbaj0 for the suggestions. 🙌🏼
🙌 1
❤️ 1
d
Thanks for posting this, I had a similar issue and used your codebase as a reference to fix my issue @Vivek Choudhary
👍 1
z
I haven't found an actual issue for the clearAllTables problem, so I created one here https://issuetracker.google.com/issues/348166275
615 Views