https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

Suresh Maidaragi

12/02/2023, 12:21 AM
we are started seeing this issue while archiving the iOS build from Xcode, can someone help to check
Copy code
error: Compilation failed: Java heap space

 * Source files: 
 * Compiler version: 1.9.20
 * Output kind: FRAMEWORK

error: java.lang.OutOfMemoryError: Java heap space


> Task :shared:linkReleaseFrameworkIosArm64 FAILED
error: Compilation finished with errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':shared:linkReleaseFrameworkIosArm64'.
> Compilation finished with errors

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.
Copy code
error: Compilation failed: Java heap space

 * Source files: 
 * Compiler version: 1.9.20
 * Output kind: FRAMEWORK

error: java.lang.OutOfMemoryError: Java heap space
	at org.jetbrains.kotlin.backend.konan.optimizations.DevirtualizationAnalysis$DevirtualizationAnalysisImpl.buildConstraintGraphPrecursor(DevirtualizationAnalysis.kt:805)
	at org.jetbrains.kotlin.backend.konan.optimizations.DevirtualizationAnalysis$DevirtualizationAnalysisImpl.buildConstraintGraph(DevirtualizationAnalysis.kt:760)
	at org.jetbrains.kotlin.backend.konan.optimizations.DevirtualizationAnalysis$DevirtualizationAnalysisImpl.analyze(DevirtualizationAnalysis.kt:448)
	at org.jetbrains.kotlin.backend.konan.optimizations.DevirtualizationAnalysis.run(DevirtualizationAnalysis.kt:1359)
	at org.jetbrains.kotlin.backend.konan.driver.phases.LTOKt$DevirtualizationAnalysisPhase$2.invoke(LTO.kt:70)
	at org.jetbrains.kotlin.backend.konan.driver.phases.LTOKt$DevirtualizationAnalysisPhase$2.invoke(LTO.kt:56)
	at org.jetbrains.kotlin.backend.konan.driver.phases.PhaseBuildersKt$createSimpleNamedCompilerPhase$1.phaseBody(PhaseBuilders.kt:32)
	at org.jetbrains.kotlin.backend.common.phaser.SimpleNamedCompilerPhase.phaseBody(CompilerPhase.kt:207)
	at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedCompilerPhase.invoke(CompilerPhase.kt:94)
	at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine.runPhase(Machinery.kt:139)
	at org.jetbrains.kotlin.backend.konan.driver.phases.TopLevelPhasesKt.runCodegen(TopLevelPhases.kt:360)
	at org.jetbrains.kotlin.backend.konan.driver.phases.TopLevelPhasesKt.runBackendCodegen(TopLevelPhases.kt:321)
	at org.jetbrains.kotlin.backend.konan.driver.phases.TopLevelPhasesKt.compileModule(TopLevelPhases.kt:251)
	at org.jetbrains.kotlin.backend.konan.driver.phases.TopLevelPhasesKt.runBackend$lambda$9$runAfterLowerings(TopLevelPhases.kt:105)
	at org.jetbrains.kotlin.backend.konan.driver.phases.TopLevelPhasesKt.runBackend(TopLevelPhases.kt:124)
	at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver.produceObjCFramework(DynamicCompilerDriver.kt:76)
	at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver.access$produceObjCFramework(DynamicCompilerDriver.kt:31)
	at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver$run$1$1$1.invoke(DynamicCompilerDriver.kt:42)
	at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver$run$1$1$1.invoke(DynamicCompilerDriver.kt:36)
	at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine$Companion$startTopLevel$topLevelPhase$1.phaseBody(Machinery.kt:98)
	at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine$Companion$startTopLevel$topLevelPhase$1.phaseBody(Machinery.kt:92)
	at org.jetbrains.kotlin.backend.common.phaser.SimpleNamedCompilerPhase.phaseBody(CompilerPhase.kt:207)
	at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedCompilerPhase.invoke(CompilerPhase.kt:94)
	at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine$Companion.startTopLevel(Machinery.kt:105)
	at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver.run(DynamicCompilerDriver.kt:36)
	at org.jetbrains.kotlin.backend.konan.KonanDriver.run(KonanDriver.kt:118)
	at org.jetbrains.kotlin.cli.bc.K2Native.runKonanDriver(K2Native.kt:151)
	at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:69)
	at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:36)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:104)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:48)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)


> Task :shared:linkReleaseFrameworkIosArm64 FAILED
error: Compilation finished with errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':shared:linkReleaseFrameworkIosArm64'.
> Compilation finished with errors

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to <https://docs.gradle.org/8.2.1/userguide/command_line_interface.html#sec:command_line_warnings> in the Gradle documentation.

BUILD FAILED in 50s
6 actionable tasks: 3 executed, 3 up-to-date
p

Pablichjenkov

12/02/2023, 12:48 AM
You might need to give more ram to your gradle and JVM process
s

Suresh Maidaragi

12/02/2023, 1:03 AM
@Pablichjenkov in xcode ?
p

Pablichjenkov

12/02/2023, 1:46 AM
This property:
org.gradle.jvmargs=-Xms4g -Xmx8g
I don’t know where you set it up, I do it in
gradle.properties
in the kotlin project root directory
s

Suresh Maidaragi

12/02/2023, 5:25 AM
wow @Pablichjenkov thanks a lot sir, you saved my day🙏
p

Pablichjenkov

12/03/2023, 2:32 AM
lol😸👍
11 Views