Chiaradia Juan
07/22/2025, 12:06 PMkmp-compose-lib
that will provide common compose-ui and other features to an iOS and android app.
We split the umbrella library in multiple modules, for example, one module for our design-system
and another for our home-tab
.
umbrella-project
-- kmp-lib
-- compose-ui
---- design-system
---- home-tab-root
and where kmp-lib
relevant gradle script parts looks like:
val xcf = XCFramework("KmpLib")
val iosTargets = listOf(iosArm64(), iosSimulatorArm64())
iosTargets.forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "KmpLib"
isStatic = true
export(projects.composeUi.homeTabRoot)
export(projects.composeUi.designSystem)
xcf.add(this)
}
}
The problem we are facing is that when creating the XCFramework the assemble task takes forever until eventually it throws a heap OOM.
We are running on macos, 32 gb, and are assigning 8G to the heap and daemon.
Has anyone faced a similar issue?
Compilation failed: Java heap space
* Source files:
* Compiler version: 2.2.0
* Output kind: FRAMEWORK
Andres Schmois
07/22/2025, 4:13 PMChiaradia Juan
07/23/2025, 6:33 AMChiaradia Juan
07/23/2025, 6:52 AMkmp-lib (umbrella - compose)
design-system (compose)
navigation (compose)
ui (compose)
domain
and with no big dependencies other than compose
(we also have ktor)Timofey Solonin
07/23/2025, 9:35 AM-Dorg.gradle.jvmargs="-Xmx8g ... other jvmargs ... XX:+FlightRecorder -XX:FlightRecorderOptions=stackdepth=256 -XX:StartFlightRecording,settings=profile,filename=/path/to/oom.jfr"
You can also make sure you have linkage caching enabled and build debug binaries for development to speed up build.