Hey I’m having a weird issue when building iOS reg...
# multiplatform
r
Hey I’m having a weird issue when building iOS regarding Kotlin Coroutines coming from Kotlin
stdlib
and a ksp task. I cannot find information out there, it seems to be a very unique error. Error in 🧵 Does anyone know what would cause a build in Xcode Cloud to fail only there? Building the app and executing archive locally works fine 🤔
Copy code
2025-05-10T16:41:11.461419908Z > Task :shared:iosArm64ResolveResourcesFromDependencies

2025-05-10T16:41:11.461422345Z > Task :shared:assembleIosArm64MainResources

2025-05-10T16:41:11.461425456Z > Task :shared:iosArm64ResolveSelfResourcesCopyHierarchicalMultiplatformResources

2025-05-10T16:41:11.461428790Z > Task :shared:iosArm64AggregateResources

2025-05-10T16:41:11.461430864Z

2025-05-10T16:41:11.461433228Z > Task :shared:kspKotlinIosArm64 FAILED

2025-05-10T16:41:11.461436296Z e: [ksp] java.lang.IllegalStateException: cannot find required type XTypeName[kotlin.coroutines.Continuation / kotlin.coroutines.Continuation]

2025-05-10T16:41:11.461438871Z

2025-05-10T16:41:11.461443629Z > Task :shared:iosSimulatorArm64ResolveResourcesFromDependencies

2025-05-10T16:41:11.461449793Z error: cannot find required type XTypeName[kotlin.coroutines.Continuation / kotlin.coroutines.Continuation]

2025-05-10T16:41:11.461547449Z error: cannot find required type XTypeName[kotlin.coroutines.Continuation / kotlin.coroutines.Continuation]

2025-05-10T16:41:11.461595916Z

2025-05-10T16:41:11.461598648Z FAILURE: Build failed with an exception.

2025-05-10T16:41:11.461602020Z

2025-05-10T16:41:11.461604094Z * What went wrong:

2025-05-10T16:41:11.461606290Z Execution failed for task ':shared:kspKotlinIosArm64'.

2025-05-10T16:41:11.461609329Z > A failure occurred while executing com.google.devtools.ksp.gradle.KspAAWorkerAction

2025-05-10T16:41:11.461612472Z > cannot find required type XTypeName[kotlin.coroutines.Continuation / kotlin.coroutines.Continuation]

2025-05-10T16:41:11.461615847Z
Kotlin: 2.1.20 ksp: 2.1.20-2.0.1 (tried minor versions) I have: • Kmp nativecoroutines plugin applied • I don’t have
coroutines-core
dependency, I tried adding it to see if that solves it but didn’t.
a
XTypeName looks like it might come from room’s compiler-processing
r
You’re right, I’ve checked now and it seems to be a room thing. I’m using latest room/sqlite versions room: 2.7.1 sqlite: 2.5.1 Sharing buildscript of how room is applied:
Copy code
plugins {
    alias(libs.plugins.room)
}

room {
    schemaDirectory("$projectDir/schemas")
}

androidMain.dependencies {
    implementation(libs.room.runtime.android)
}

commonMain.dependencies {
    implementation(libs.room.runtime)
    implementation(libs.sqlite.bundled)
    implementation(libs.sqlite.ktx)
}

dependencies {
    add("kspCommonMainMetadata", libs.room.compiler)
    add("kspAndroid", libs.room.compiler)
    add("kspIosSimulatorArm64", libs.room.compiler)
    add("kspIosX64", libs.room.compiler)
    add("kspIosArm64", libs.room.compiler)
}
I don’t see any strange configuration 🤔
Added info level to gradle Probably got a winner, either KMPNativeCoroutines or Room
Copy code
2025-05-11T08:57:42.049221577Z	> Task :shared:kspKotlinIosArm64
2025-05-11T08:57:42.049224315Z	i: [ksp] loaded provider(s): [com.rickclephas.kmp.nativecoroutines.ksp.KmpNativeCoroutinesSymbolProcessorProvider, androidx.room.RoomKspProcessor$Provider]
2025-05-11T08:57:42.049227378Z	e: [ksp] java.lang.IllegalStateException: cannot find required type XTypeName[kotlin.coroutines.Continuation / kotlin.coroutines.Continuation]
2025-05-11T08:57:42.049229457Z	
2025-05-11T08:57:42.049231183Z	> Task :shared:kspKotlinIosArm64 FAILED
I still wonder why it only fails in XCode cloud and not locally when doing
archive
. It’s quite strange… 🤔
I’ll wait for a new room version using the kotlin/ksp that I’m using and see if that solves it
w
Hi, Did you manage to solve this? I faced today exactly the same issue. Locally it builds fine, but it does fail on our CI setup though.
Just to let you know and someone else in the future it looks like downgrading KSP to the exact same version as room uses fixed the problem and now the build passes as expected in our case.