hello! i'm using room. The android builds fine, bu...
# multiplatform
h
hello! i'm using room. The android builds fine, but the ios side doesn't build. I don't know what to do because when I build ios it says there is no library for "org.jetbrains.kotlinx:kotlinx-coroutines-android" i think room library used this lib internal but room is common lib. I've googled it but it doesn't come up. Is there a good way? I'll leave the error log and code in the comments "androidx.room.ktx" this library was the problem, I shouldn't have added it. i remove it then ios works. Additionally if you have
Copy code
[ksp] java.lang.NullPointerException
on ios build, please add "ksp.useKSP2=true" in gradle.properties
👍 1
Copy code
Xcode error log
No matching variant of org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3 was found. The consumer was configured to find a library for use during 'kotlin-api', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.klib.packaging' with value 'non-packed', attribute 'org.jetbrains.kotlin.native.target' with value 'ios_arm64', attribute 'org.jetbrains.kotlin.platform.type' with value 'native' but:
Copy code
The version i'm using -> 
androidx-room = "2.7.0-rc01"
androidx-sqlite = "2.5.0-rc01"
kotlinx-coroutines = "1.10.1"
androidx-room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "androidx-room" }
androidx-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "androidx-room" }
androidx-room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "androidx-room" }
androidx-sqlite-bundled = { group = "androidx.sqlite", name = "sqlite-bundled", version.ref = "androidx-sqlite" }
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
Copy code
I'm attaching this just in case. It works fine on Android           apply(libs.plugin("room").pluginId)
            apply(libs.plugin("ksp").pluginId)

            arg("room.generateKotlin", "true")

            schemaDirectory("$projectDir/schemas")

        dependencies {
            add("kspAndroid", libs.library("androidx.room.compiler"))
            add("kspIosSimulatorArm64", libs.library("androidx.room.compiler"))
            add("kspIosX64", libs.library("androidx.room.compiler"))
            add("kspIosArm64", libs.library("androidx.room.compiler"))
        }

        dependencies {
            commonMainImplementation(libs.library("androidx.room.runtime"))
            commonMainImplementation(libs.library("androidx.room.ktx"))
            commonMainImplementation(libs.library("androidx.sqlite.bundled"))
        }
"androidx.room.ktx" this library was the problem, I shouldn't have added it