Franklin
03/15/2023, 11:47 AM$ /Applications/MyApp.app/Contents/MacOS/MyApp
Error occurred during initialization of VM
Could not reserve enough space for code cache (245760K)
Locally, my app builds and runs just fine. However, I don't have the certs too sign it locally. Would anyone know what's up?
I tried running a CI build using a commit from weeks ago that I know in the past has generated a perfectly normal executable/binary, and that still failed with the same error. So it's almost certainly due to some change on the CI machines, I'm just trying to narrow down what?Oleksandr Karpovich [JB]
03/16/2023, 8:29 AMFranklin
03/16/2023, 8:34 AMjvmArgs("-XX:InitialCodeCacheSize=160K", "-XX:ReservedCodeCacheSize=32M")
Built it locally, still runs fine. Built it on CI machines and I still get
Error occurred during initialization of VM
Could not reserve enough space for code cache (32768K)
HmmFranklin
03/16/2023, 8:40 AMOleksandr Karpovich [JB]
03/16/2023, 8:45 AMcompose.desktop {
application {
jvmArgs += listOf("-Xmx2G") // <- this
}
}
affect the packaged (+signed) distribution? Is it applied to the packaged distribution?Franklin
03/16/2023, 8:49 AMbuild/compose/tmp/createDistributable.args.txt
that has
--java-options
"'-XX:InitialCodeCacheSize=160K'"
--java-options
"'-XX:ReservedCodeCacheSize=32M'"
i.e. the settings I configured. That's for running jpackage
(I think).Franklin
03/16/2023, 8:51 AMbuild.gradle.kts
compose.desktop {
application {
mainClass = ""
jvmArgs("-XX:InitialCodeCacheSize=160K", "-XX:ReservedCodeCacheSize=32M")
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = ""
packageVersion = version as String
modules("java.sql")
macOS {
bundleID = ""
iconFile.set(project.file("image/.icns"))
}
}
}
}
(with some strings redacted).jim
03/16/2023, 9:06 AMFranklin
03/16/2023, 9:08 AMjim
03/16/2023, 9:09 AMFranklin
03/16/2023, 9:38 AMjim
03/16/2023, 9:40 AMspierce7
03/17/2023, 8:32 AMFranklin
03/17/2023, 9:25 AMdefault.entitlements
or whatever you want to name it
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "<http://www.apple.com/DTDs/PropertyList-1.0.dtd>">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>
In your build.gradle.kts
file add
compose.desktop {
application {
mainClass = ""
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = ""
packageVersion = version as String
macOS {
bundleID = ""
iconFile.set(project.file(""))
entitlementsFile.set(project.file("default.entitlements")) // <----------- this line
}
}
}
}
spierce7
03/17/2023, 2:27 PMjim
03/17/2023, 3:51 PMspierce7
03/17/2023, 3:58 PMspierce7
03/17/2023, 3:59 PM