尝试在 Kotlin Multiplatform 上构建 iOS 胖框架,但失败并出现错误:
* 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)
Gradle 属性 ~/.gradle/gradle.properties:
org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_311.jdk/Contents/Home
org.gradle.jvmargs=-XX:MaxMetaspaceSize=2g -Xmx6g -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.daemon=true
org.gradle.parallel=true
kotlin.compiler.execution.strategy=in-process
构建胖框架的任务:
tasks.register<FatFrameworkTask>("releaseFatFramework") {
baseName = "MyKMM"
destinationDir = buildDir.resolve("fat-framework/release")
from(
iosArm64().binaries.getFramework("RELEASE"),
iosX64().binaries.getFramework("RELEASE")
)
}
Gradle 守护程序在 2g - 3g 内存使用量时被杀死/消失。
环境:Java 8、11 和 17、Kotlin 1.4.32、Gradle 6.5.1、macOS Big Sur
有什么想法有什么问题吗?它曾经建造得很好。任何帮助深表感谢。