I’m trying to use the brand new Room KPM library to replace my current implementation of SQLDelight.
My project is full KMP with Compose Multiplatform and use a loooot of alpha/beta/experimental libraries:
kotlin = "2.0.0-RC2"
ksp = "2.0.0-RC2-1.0.20"
jetbrains-compose-mutilplatform = "1.6.10-beta03"
jetbrains-compose-navigation = "2.8.0-alpha02"
androidx-room = "2.7.0-alpha01"
androidx-sqlite-bundled = "2.5.0-alpha01"
I have a common-local
module that contains the database. The androidx.room plugin is applied on this module, along with KSP.
I have a feature-local
module that contains the DAOs and the entities for the feature. I applied only KSP on this module.
It works on Android. But on iOS, I have two problems:
instantiateImpl()
method is not resolved, even if I see it in generated files for iosArm64- And I get the following exception (only on iOS)
I tried to follow this https://github.com/android/kotlin-multiplatform-samples/tree/main/Fruitties. Even if I put everything in common-local and remove feature-local, I can’t make it work on iOS. I don’t see any differences between the sample and my project in the configuration, expect that I use K2 and tried to use multi-module.
Is there something obvious I am missing?
PS: I can’t share my project entirely at this moment, but it is build like this:
- common-local imports feature-local
- common-di expose methods to initialize DI with Koin
- feature-domain exposes use case to access the database
- feature-ui imports domain and expose a route/screen with a ViewModel.
- shared imports feature-ui and implements the navigation.
- iosApp and AndroidApp only import shared.