joney
08/12/2025, 6:18 PM.klib
from Maven in separate project
I have two separate Kotlin Multiplatform projects
• Project A contains domain
+ ui
modules, with the ui
module using Compose Multiplatform resources (fonts, etc.). It publishes .klib
artifacts to Maven (including a kotlin_resources.kotlin_resources.zip
per target).
• Project B unrelated Gradle build. It consumes the .klib
from Maven and builds an .xcframework
for iOS.
When I run assembleXCFramework
in Project A and use that in the iOS app, resources are bundled correctly and the app works. But when I build the .xcframework
in Project B using the Maven .klib
, the Compose resources are missing at runtime and the app crashes (can't find fonts).
I already add dependencies in Project B to the kotlin_resources.kotlin_resources.zip
artifacts for each iOS target, but I’m not sure how to hook them into the Gradle framework build so they end up in the .framework
Resources
folder.
❓*What’s the correct way in a separate Gradle project to consume those published Compose resources from Maven and ensure they are included in the .xcframework
output like in Project A’s assembleXCFramework
?*
🙏 Any example of how to wire the unpack + copy step into the Kotlin/Native framework tasks would be appreciated.
PS: The idea behind this setup is to ease distribution of shared code to the iOS app. Alternatively we would consume the .xcframework
from Project A with SPM.
cc/ @Kilianjoney
08/13/2025, 12:54 PM