Thread
#multiplatform
    rsetkus

    rsetkus

    9 months ago
    Hi. Trying to build iOS fat framework on Kotlin Multiplatform but it is failing with error:
    * What went wrong:
    Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
    Gradle properties:
    org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_311.jdk/Contents/Home
    org.gradle.jvmargs=-Xmx6G
    org.gradle.daemon=true
    org.gradle.parallel=true
    Gradle deamon gets killed/disappears at 2g - 3g memory usage. Task to build fat framework:
    tasks.register<FatFrameworkTask>("releaseFatFramework") {
        baseName = "MyKMM"
        destinationDir = buildDir.resolve("fat-framework/release")
        from(
            iosArm64().binaries.getFramework("RELEASE"),
            iosX64().binaries.getFramework("RELEASE")
        )
    }
    Environment: Java 8, 11 and 17, Kotlin 1.4.32, Gradle 6.5.1, macOS Big Sur Any ideas what is wrong? It used to build fine.
    i

    Igor Milakovic

    9 months ago
    Does this happen consistently? Or was it just a one-off build?
    rsetkus

    rsetkus

    9 months ago
    It happens consistently… Tried various java versions and different gradle property setups. No luck… It exists without any reason why it crashed/got killed
    i

    Igor Milakovic

    9 months ago
    Ugh... It was intermittent for us, but increasing the memory has helped
    org.gradle.daemon=true
    org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError
    Those were our daemon related settings in
    gradle.properties
    - may be worth a shot?
    rsetkus

    rsetkus

    9 months ago
    Same…
    * Exception is:
    org.gradle.launcher.daemon.client.DaemonDisappearedException: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
            at org.gradle.launcher.daemon.client.DaemonClient.handleDaemonDisappearance(DaemonClient.java:250)
            at org.gradle.launcher.daemon.client.DaemonClient.monitorBuild(DaemonClient.java:223)
            at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:185)
            at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:148)
            at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:99)
            at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:56)
            at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:212)
            ....
            at org.gradle.launcher.Main.doAction(Main.java:35)
            at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:50)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:568)
            at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
            at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
            at org.gradle.launcher.GradleMain.main(GradleMain.java:31)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:568)
            at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:35)
            at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
            at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
    i

    Igor Milakovic

    9 months ago
    Even if you allow for more memory than 2gb in that example?
    rsetkus

    rsetkus

    9 months ago
    Yep. It always goes away when java process reaches roughly 2g even though I’ve set >2g
    i

    Igor Milakovic

    9 months ago
    Huh, not sure then. Sorry it wasn't helpful 😞