App crash on start complaining invalid signature

I've been at this for hours, searching all over, trying to find a solution. I've created a very simple app, basically 1 window that has a label saying "Hello World". 'm trying to sign this app with a Provisioning Profile that was created like so:

  1. Created "Mac App Distribution" and "Mac Installer Distribution" certificates. Installed them, they show as valid "3rd Party Mac Developer..." in Keychain Access.
  2. Created an Identifier for an "app", gave a Description and Bundle ID
  3. Created a Profile for a "Mac App Store" type Distribution, used my ID from step 2, chose the "Mac App Distribution" certificate (there was only one), inputted a profile name

Then, over to xcode. In Signing & Capabilities uncheck "Automatically manage signing", enter the Bundle Identifier as it was made in step 2 above, import profile as was created in step 3 above. All seems well, however when I press that play button in order to compile and run, I immediately get a "quit unexpectedly" with the following in the details:

Exception Type:  EXC_CRASH (SIGKILL (Code Signature Invalid))
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: CODESIGNING 1 Taskgated Invalid Signature

I can create a "Developer ID Application" no problem, but all goes awry when trying to build in order to make it to the Apple Store.

I'm on 16-inch 2019 MacBook Pro, Sonoma 14.1.1, xcode 15.0.1.

Is there something super lame I've looked over?

I should clarify, upon hitting xcode's play button, the code build successfully, then upon running it immediately quits.

You’re trying to run App Store Distribution-signed code. Don’t do that. See Don’t Run App Store Distribution-Signed Code for an explanation.

Use Apple Developer signing for day-to-day development. This is what you get if you re-enable automatic code signing, which is what I generally recommend.

If you plan to distribute your app via the App Store, test your distribution using TestFlight.

If you plan to distribute your app directly, you can test your Developer ID signed version directly. Don’t use Developer ID for day-to-day development. See The Care and Feeding of Developer ID for more on that.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

App crash on start complaining invalid signature
 
 
Q