compose-multiplatform
compose-multiplatform copied to clipboard
Signed MacOS app crashes with (Code Signature Invalid)
Describe the bug Signed MacOS app crashes with (Code Signature Invalid). It passes verification in the Transporter app.
Affected platforms
- Desktop
Versions
- kotlin.code.style=official
- kotlin.version=1.7.10 (tested also on 1.8.10)
- agp.version=7.3.0
- compose.version=1.2.0 (tested also on 1.3.1)
- jdk-18.0.2.1.jdk
- on MacOS Ventura 13.1 M1pro
- XCode Version 14.2 (14C18)
To Reproduce I am trying to create a .pkg to upload it to the Mac AppStore with the TestFlight enabled..
- Create a project in IntelliJ:

- Certificates:
Add two certificates to the Keychain Access:
Mac App Distribution Mac Installer Distribution

- Register App IDs:

- Prepare Provisioning Profiles:

(Make sure that the provisioning profiles are prepared for the right certificates)
- Configure Gradle DSL:
Copiy EmbeddedForComposeForMacOs.provisionprofile to the projectDir and rename to: embedded.provisionprofile Copy runtimeComposeForMacOs.provisionprofile to the projectDir and rename to: runtime.provisionprofile
Add entitlements files:
In my case in entitlements.plist I used these values:
...
<key>com.apple.application-identifier</key>
<string>6B2GN3FRAK.com.rjuszczyk.composeformacos</string>
<key>com.apple.developer.team-identifier</key>
<string>6B2GN3FRAK</string>
...
- Create the app in the appstoreconnect.apple.com:

-
Run
packagePkg
task -
Drag and drop generated .pkg to Transporter app and click Verify
-
I was getting this error:
-
So I specified javaHome to point to x64 jdk in (build.gradle)
javaHome = "/Library/Java/JavaVirtualMachines/jdk-18.0.2.1.jdk/Contents/Home/"
Clean and run packagePkg
again and check it in the Transporter app
Now it verifies without errors:

- But when I try to run the .app from build/compose/binaries/main/app directory it fails with error:

- Then I published it to the App Store Connect and added a test group and added a version to TestFlight which then I downloaded via the TestFlight app and tried to open:

But when I click OPEN, nothing happens.
Expected behavior
- The .app should not crash with Code Signature Invalid.
- The .pkg should install (now nothing happens).
- The TestFlight build should open in TestFlight (now nothing happens)