Hi everyone, For the life of me I cannot figure ou...
# multiplatform
k
Hi everyone, For the life of me I cannot figure out why my library's CI build keeps failing on the commonizeCInterop portion of the build on github actions. Everything works locally, and runs successfully inside my sample project but the build always fails with something like
Error: Exception in thread "main" java.lang.IllegalStateException: Unresolved classifier: platform/WatchConnectivity/WCSession
for which I've played whack-a-mole on countless ways to resolve the issue. For context, it uses swiftklib plugin to help with the HealthKit specific dependencies. I've even gone so far as replacing that plugin with compiling the code myself in the gradle file with customized def files to ensure depends in the def file brings in the missing dependencies, none of which has had any success. I feel like I'm missing something simple that's different between my local environment and the build server but for the life of me can't figure out what it is. Any help would be greatly appreciated. The project: https://github.com/crowded-libs/vitality
t
Probably related: KT-71694 Leaking platform APIs fail to commonize with "Unresolved classifier: platform/UIKit/UIDocumentCreationIntent" try to use ``kotlin.mpp.enableCInteropCommonization=false`
k
It definitely seems related. I tried updating the build server to xcode 15 and it had no affect one way or the other, but it's doubtful from the bug description that it's really isolated to xcode 16 + KN.
Actually I take it back, the library is already on 2.2.10 for Kotlin. It sounds very similar.
Disabling the gradle configuration cache as mentioned in this issue worked around the issue and made the CI build pass. https://youtrack.jetbrains.com/issue/KT-77732/commonizeCInterop-failed-with-Unresolved-classifier-platform-posix-sizet
u
In your ci file, run the commonizeCInterop task once before the main gradle command, and allowed to fail, then the main gradle command will run successfully
k
disabling the gradle configuration cache seems less hacky than let it fail once first