Missing code-signing certificate when uploading MacOS installer to AppStore

Hi there!

I have an issue with uploading a PKG installer to the MacOS AppStore.

Uploading with:

xcrun altool --upload-app -t macos -f $PKGPATH -u $DEVELOPER_ID -p $APP_SPECIFIC_PWD

results in error:

*** Error: Validation failed Invalid Provisioning Profile. The provisioning profile included in the bundle com.frogblue.frogCom [com.frogblue.frogCom.pkg/Payload/frogSIP.app] is invalid. [Missing code-signing certificate.] For more information, visit the macOS Developer Portal. (ID: fc4e5488-6d09-4ab2-b1f7-017a33c69723) (409)

Application seems to be correctly code signed with „3rd Party Mac Developer Application“ certificate.

codesign -dv --verbose=4 /Users/dietmar.finkler/Desktop/frogSIP/deploy/frogSIP.app
Identifier=com.frogblue.frogCom
Format=app bundle with Mach-O universal (x86_64 arm64)
CodeDirectory v=20500 size=266432 flags=0x10000(runtime) hashes=8315+7 location=embedded
VersionPlatform=1
VersionMin=720896
VersionSDK=918784
Hash type=sha256 size=32
CandidateCDHash sha256=923de799a54616706b76050b50b7ee6d59f8355a
CandidateCDHashFull sha256=923de799a54616706b76050b50b7ee6d59f8355a65aa7cce03e34bb2033da1e9
Hash choices=sha256
CMSDigest=923de799a54616706b76050b50b7ee6d59f8355a65aa7cce03e34bb2033da1e9
CMSDigestType=2
Executable Segment base=0
Executable Segment limit=31604736
Executable Segment flags=0x1
Page size=4096
CDHash=923de799a54616706b76050b50b7ee6d59f8355a
Signature size=9109
Authority=3rd Party Mac Developer Application: frogblue TECHNOLOGY GmbH (UG2P6T5LNH)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Timestamp=26.02.2025 at 10:07:08
Info.plist entries=31
TeamIdentifier=UG2P6T5LNH
Runtime Version=14.5.0
Sealed Resources version=2 rules=13 files=1124
Internal requirements count=1 size=212

The PKG build with productbuild seems also be correctly code signed with„3rd Party Mac Developer Installer“ certificate.

pkgutil --check-signature /Users/dietmar.finkler/Desktop/frogSIP/frogSIP-1.2a2.pkg 
Status: signed by a developer certificate issued by Apple (Development)
   Certificate Chain:
    1. 3rd Party Mac Developer Installer: frogblue TECHNOLOGY GmbH (UG2P6T5LNH)
       Expires: 2026-02-25 17:17:54 +0000
       SHA256 Fingerprint:
           D1 9E AC 27 C7 26 F3 2E 1E F5 50 2C 7A 1B 1D FB 54 D6 17 C1 1C 58 
           C1 7E F8 87 B6 44 D1 49 17 DC
       ------------------------------------------------------------------------
    2. Apple Worldwide Developer Relations Certification Authority
       Expires: 2030-02-20 00:00:00 +0000
       SHA256 Fingerprint:
           DC F2 18 78 C7 7F 41 98 E4 B4 61 4F 03 D6 96 D8 9C 66 C6 60 08 D4 
           24 4E 1B 99 16 1A AC 91 60 1F
       ------------------------------------------------------------------------
    3. Apple Root CA
       Expires: 2035-02-09 21:40:36 +0000
       SHA256 Fingerprint:
           B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C 
           68 C5 BE 91 B5 A1 10 01 F0 24

KeyChain login items show both "3rd Party Mac Developer Application" and "3rd Party Mac Developer Installer“ certificates.

But checking with security find-identity -v -p codesigning shows only the "3rd Party Mac Developer Application“ certificate. "3rd Party Mac Developer Installer“ is missing.


I check also the entitlement in the app package, which looks ok for me.

codesign -d --entitlements :- /Users/dietmar.finkler/Desktop/frogSIP/deploy/frogSIP.app 
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.application-identifier</key><string>UG2P6T5LNH.com.frogblue.frogCom</string><key>com.apple.developer.aps-environment</key><string>production</string><key>com.apple.developer.associated-domains</key><array><string>applinks:go.dev.frogblue.cloud</string><string>applinks:go.test.frogblue.cloud</string><string>applinks:go.prod.frogblue.cloud</string></array><key>com.apple.developer.team-identifier</key><string>UG2P6T5LNH</string><key>com.apple.security.app-sandbox</key><true/><key>com.apple.security.cs.disable-library-validation</key><true/><key>com.apple.security.device.audio-input</key><true/><key>com.apple.security.device.camera</key><true/><key>com.apple.security.network.client</key><true/><key>com.apple.security.network.server</key><true/></dict></plist>

What I am missing? Thanx for any hint!

Regards Dietmar Finkler

Answered by DTS Engineer in 827108022

This error tells you what’s going on, it’s just a little subtle:

The provisioning profile included in the bundle … is invalid. [Missing code-signing certificate.]

The issue isn’t with your code-signing identity’s certificate per se, but rather a mismatch between it and your provisioning profile. A profile authorises your code to run based on certain criteria. One of those criteria is the allowed list of certificates whose identity’s can sign that code. This error means that the code is signed with an identity whose certificate isn’t listed in the profile.

To investigate this, extract the profile from your app and dump the certificates in its allowlist. See TN3125 Inside Code Signing: Provisioning Profiles for instructions on how to do this.

I suspect you’re signing code by hand, rather than with Xcode. In that case I recommend that you read through Creating distribution-signed code for macOS. It has a section, Embed distribution provisioning profiles, that explains this issue in more detail.

Share and Enjoy

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

This error tells you what’s going on, it’s just a little subtle:

The provisioning profile included in the bundle … is invalid. [Missing code-signing certificate.]

The issue isn’t with your code-signing identity’s certificate per se, but rather a mismatch between it and your provisioning profile. A profile authorises your code to run based on certain criteria. One of those criteria is the allowed list of certificates whose identity’s can sign that code. This error means that the code is signed with an identity whose certificate isn’t listed in the profile.

To investigate this, extract the profile from your app and dump the certificates in its allowlist. See TN3125 Inside Code Signing: Provisioning Profiles for instructions on how to do this.

I suspect you’re signing code by hand, rather than with Xcode. In that case I recommend that you read through Creating distribution-signed code for macOS. It has a section, Embed distribution provisioning profiles, that explains this issue in more detail.

Share and Enjoy

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

Hi Quinn!

Thanks a lot, this gives me the correct hint to go a step further! My App Store provisioning profile did not contain any certificate at all.

So now I can archive may app in Xcode and distribute it: Custom > App Store Connect > Export > Manually manage signing > Distribution certificate: Mac App Distribution Installer certificate: Mac Installer Distribution frogSIP.app: frogSIP Mac App Store Connect (the fixed provisioning profile)

This gives me a pkg installer. I now extract the app package from the installer, because I have to do further deployment for my Qt app package.

Then the app package is deployed and code signed with Qt tool macdeployqt6 and certificate "3rd Party Mac Developer Application“. The pkg installer is build with productbuild and signed with certificate ""3rd Party Mac Developer Installer“.

Finally uploaded the pkg with xcrun altool.

Puh ... the old error [Missing code-signing certificate.] is fixed.

But ...

 *** Error: ERROR: [ContentDelivery.Uploader] Validation failed (409) Invalid bundle. The executable couldn’t be re-signed for upload to App Store Connect. The app may have been built or signed with unsupported or prerelease tools. (ID: e43b0690-efd9-402d-a7c8-9fde27199a7c)

*** Error: ERROR: [ContentDelivery.Uploader] Validation failed (409) Invalid Bundle. The application bundle may not contain tools or frameworks provided by Apple, or using bundle identifiers in the 'com.apple.' namespace. Invalid bundle: [com.frogblue.frogCom.pkg/Payload/frogSIP.app/Contents/Resources/qml/QtCore/libqtqmlcoreplugin.dylib.dSYM], with bundle identifier 'com.apple.xcode.dsym.qtqmlcoreplugin'. (ID: b0c9769c-9813-4674-9db5-226321dfc2c8)

Guess this is related to the Qt Resources and Plugins structure which are added to the app package. I can’t see the reason for a ‚com.apple.xcode.dsym.qtqmlcoreplugin‘ bundle identifier.

Any idea how to correctly manage a Mac App Store upload for Qt applications? Should I prefer static linking Qt libraries or how to correctly add Qt Frameworks, Resources and Plugins?

Thank you in advance Dietmar

Dietmar, I had a similar issue some time ago. It sounds like you've navigated a complex signing process, and you're very close! The error message clearly points to an issue with a debug symbol file (.dSYM) within your application bundle having an Apple-reserved bundle identifier (com.apple.xcode.dsym...). This typically happens when these files aren't properly handled during the deployment and signing process for third-party applications.

Understanding the Error:

The App Store Connect validation is rejecting your build because it found a .dSYM file with a bundle identifier that belongs to Apple. This suggests that either:

Debug Symbols for Qt Plugins are Included Incorrectly: The .dSYM file for the libqtqmlcoreplugin.dylib (a Qt plugin) is being bundled in a way that retains Apple's internal identifier. Incorrect Handling of .dSYM Files during macdeployqt6: The macdeployqt6 tool might be copying these debug symbol files without the necessary modifications for App Store distribution. Strategies for Correctly Managing Qt for Mac App Store Distribution:

Here's a breakdown of approaches and steps you should consider:

1. Focus on Release Builds and Stripping Symbols:

Build in Release Mode: Ensure your Qt application is built in Release mode. Debug builds often include extensive debugging symbols that are not needed for the App Store.

Strip Symbols: The most crucial step is to strip debugging symbols from your application and all its dependencies (Qt frameworks, plugins, and your own libraries) before creating the final .app bundle. This removes the .dSYM files that are causing the issue.

You can use the strip command-line tool on macOS for this. For example:

Bash
strip -x frogSIP.app/Contents/Frameworks/QtCore.framework/Versions/A/QtCore
strip -x frogSIP.app/Contents/Frameworks/QtQml.framework/Versions/A/QtQml
strip -x frogSIP.app/Contents/PlugIns/QtQuick/libqtquickplugin.dylib
# ... and so on for all Qt frameworks and plugins
strip -x frogSIP.app/Contents/MacOS/frogSIP

The -x option removes the symbol table and the string table for dynamic symbols.

macdeployqt6 with --strip: The macdeployqt6 tool has a --strip option that should handle the removal of symbols. Ensure you are using this option when deploying your application.

Bash
macdeployqt6 frogSIP.app -bundle-id com.frogblue.frogSIP --strip

2. Review Your macdeployqt6 Usage:

Bundle Identifier: Double-check that you are providing the correct bundle identifier for your application (e.g., com.frogblue.frogSIP) to macdeployqt6. Plugins and Frameworks: Verify that macdeployqt6 is correctly identifying and bundling the necessary Qt frameworks and plugins. It should adjust their internal identifiers as needed for your application bundle.

3. Static vs. Dynamic Linking of Qt:

Dynamic Linking (Recommended for App Store): While static linking might seem simpler for deployment, it can lead to larger application bundles and potential compatibility issues. Dynamic linking is generally preferred for Mac App Store submissions. It allows for smaller app sizes and leverages system-provided libraries where possible (though Qt frameworks are usually bundled). If Dynamically Linking: Ensure that all the required Qt frameworks and plugins are correctly copied into your application bundle's Contents/Frameworks and Contents/PlugIns directories by macdeployqt6.

4. Inspect the Contents of Your .app Bundle:

Before Signing: After running macdeployqt6, carefully examine the contents of your frogSIP.app bundle. Look for any .dSYM files within the Contents/Frameworks or Contents/PlugIns directories, especially within the Resources/qml/QtCore path mentioned in the error. These should ideally be absent after stripping.

5. Code Signing Order and .dSYM Handling:

Sign After Deployment and Stripping: Ensure you are performing code signing after you have used macdeployqt6 and stripped the symbols. .dSYM Generation for App Store: While you need to strip the symbols from the app bundle for submission, you will likely want to keep the .dSYM files for your own crash reporting and debugging purposes. Xcode usually generates these during the archive process. You can archive your app in Xcode (as you did initially) to get these .dSYM files, but do not include them directly in the final .app bundle you deploy with macdeployqt6 and submit. You can store them separately.

Revised Workflow:

Based on the above, here's a refined workflow you should consider:

Build your Qt application in Release mode in Xcode. This will create your initial .app bundle.

Use macdeployqt6 to deploy the necessary Qt frameworks and plugins into your .app bundle. Make sure to use the correct bundle identifier and the --strip option:

Bash
/path/to/Qt/YourQtVersion/bin/macdeployqt6 frogSIP.app -bundle-id com.frogblue.frogSIP --strip
 (Replace /path/to/Qt/YourQtVersion/bin/ with the actual path to your Qt installation).

Code sign your application bundle using the "3rd Party Mac Developer Application" certificate:

Bash
codesign --deep --force --verify --sign "3rd Party Mac Developer Application" frogSIP.app
 Create the .pkg installer using productbuild:
Bash
productbuild --component frogSIP.app /Applications --sign "3rd Party Mac Developer Installer" frogSIP.pkg

Submit the .pkg file using xcrun altool (or Transporter).

Key Takeaway:

The error strongly suggests the presence of unwanted .dSYM files with Apple's bundle identifier within your final application bundle. The --strip option of macdeployqt6 is your primary tool to address this. Ensure you are using it correctly and that no stray .dSYM files are left in your .app before signing and packaging.

Missing code-signing certificate when uploading MacOS installer to AppStore
 
 
Q