compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Signed MacOS app crashes with (Code Signature Invalid)

Open rjuszczyk opened this issue 1 year ago • 0 comments

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..

  1. Create a project in IntelliJ:
image
  1. Certificates:

Add two certificates to the Keychain Access:

Mac App Distribution Mac Installer Distribution

image
  1. Register App IDs:
image
  1. Prepare Provisioning Profiles:
image

(Make sure that the provisioning profiles are prepared for the right certificates)

  1. 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>
...
  1. Create the app in the appstoreconnect.apple.com:
image
  1. Run packagePkg task

  2. Drag and drop generated .pkg to Transporter app and click Verify

  3. I was getting this error: image

  4. 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:

image
  1. But when I try to run the .app from build/compose/binaries/main/app directory it fails with error:
image
  1. 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:
image

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)

rjuszczyk avatar Mar 25 '23 11:03 rjuszczyk