Older Catalyst app with extension won't codesign

A macOS Catalyst app with an added extension was successfully built with Xcode 12.1, submitted to the Mac App Store, and approved 2 weeks ago. This macOS Catalyst app was originally built and distributed last year with an Xcode version prior to Xcode 11.4, when the maccatalyst prefix was automatically added to builds.

When trying to rebuild and update the project, unchanged except for version and build numbering, using Xcode 12.2, so that Apple Silicon support can be added, codesigning the new archive from the Organizer fails.

The error message when trying to Distribute to App Store Connect from the Organizer is:
Code Block
Code signing "rtl_tcp-SDR.app" failed.
View distribution logs for more information.

The end of the IDEDistributionPipeline.log has this message:
Code Block
2020-11-16 21:03:11 +0000 Running /usr/bin/codesign '-vvv' '--force' '--sign' 'CD25FBC289AAC880348543822E408B045CD14EAC' '--entitlements' '/var/folders/96/wwd0fl953bg48jzn669wbg1m0000gp/T/XcodeDistPipeline.~~~YB05bp/entitlements~~~RoCzdR' '--preserve-metadata=identifier,flags,runtime' '/var/folders/96/wwd0fl953bg48jzn669wbg1m0000gp/T/XcodeDistPipeline.~~~YB05bp/Root/Applications/rtl_tcp-SDR.app'
2020-11-16 21:03:11 +0000 /var/folders/96/wwd0fl953bg48jzn669wbg1m0000gp/T/XcodeDistPipeline.~~~YB05bp/Root/Applications/rtl_tcp-SDR.app: replacing existing signature
2020-11-16 21:03:11 +0000 /var/folders/96/wwd0fl953bg48jzn669wbg1m0000gp/T/XcodeDistPipeline.~~~YB05bp/Root/Applications/rtl_tcp-SDR.app: code object is not signed at all
2020-11-16 21:03:11 +0000 /usr/bin/codesign exited with 1

There is a note in "About the Mac app built with Mac Catalyst bundle ID" saying:
Code Block
Configuring Projects Created Earlier Than Xcode 11.4
If you created the Mac app built with Mac Catalyst using an earlier Xcode release than 11.4, the Mac app and iPad app have different bundle IDs. The Mac app bundle ID has a maccatalyst prefix followed by the iPad app bundle ID by default. Use the Derive Mac Catalyst Product Bundle Identifier (DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER) build setting to configure your project:
If you add an app extension, set the app extension target Derive Mac Catalyst Product Bundle Identifier build setting to YES because the Mac App Store requires that every embedded executable bundle have a bundle ID that is prefixed with the parent bundle ID.


But I get the same codesign failure with
Code Block
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER

set to either Yes or No in Build Settings, for either the app or the extension (all 4 combinations tried).

Is there an Xcode build setting or a manual codesigning sequence that will codesign an older Catalyst app with an extension so that it can be uploaded to the Mac App Store?

Do I need to create an App Identifier for the extension in Certificates, Identifiers & Profiles? With or without a maccatalyst prefix? Etc.


Answered by hotpaw2 in 649043022
The solution is in the forum thread titled: "Catalyst app with framework won't codesign", answered by ben-

In my old Xcode project, I selected my app from Targets. Then:
Select Build Settings.
Scroll down in Build Settings to Enable Bitcode.
Highlight the bold "Enable Bitcode" setting, and hit the delete key.
A new non-bold Enable Bitcode will auto-re-populate with the correct settings for Xcode 12.2.

I performed the above, and now Automatically Managed Signing just works (like it did before) and allows codesigning for upload to the App Store of my maccatalyst.* prefixed app with an included app extension.

I have the exact same issue! Mac Catalyst apps that built fine in Xcode 12.1, but then won't code sign in Xcode 12.2, even with no code changes. I filed a bug report with Apple and they are looking into this.
Accepted Answer
The solution is in the forum thread titled: "Catalyst app with framework won't codesign", answered by ben-

In my old Xcode project, I selected my app from Targets. Then:
Select Build Settings.
Scroll down in Build Settings to Enable Bitcode.
Highlight the bold "Enable Bitcode" setting, and hit the delete key.
A new non-bold Enable Bitcode will auto-re-populate with the correct settings for Xcode 12.2.

I performed the above, and now Automatically Managed Signing just works (like it did before) and allows codesigning for upload to the App Store of my maccatalyst.* prefixed app with an included app extension.

Anything new about this ?
Older Catalyst app with extension won't codesign
 
 
Q