When installing an app on an iPhone or iPad, creating an archive, or uploading a build from Xcode, you may encounter an entitlement-related signing error such as:
The application was signed with invalid entitlements.
You may also see:
The application's signature contains invalid entitlements.
or:
Entitlements specified in your application's Code Signing Entitlements file do not match those specified in your provisioning profile.
This means that the entitlements actually signed into the application do not match the entitlements authorized by the provisioning profile, App ID, or other signing configuration.
Common causes include manually adding App Groups, Push Notifications, Associated Domains, Keychain Sharing, or iCloud entitlements, using an outdated provisioning profile, signing with a profile for another bundle identifier or team, and configuring an invalid entitlement value.
The most reliable troubleshooting method is to compare the entitlements in the final code signature with those permitted by the provisioning profile rather than looking only at the source .entitlements file.
- What does “signed with invalid entitlements” mean?
- Common situations where this error appears
- Common causes
- 1. The provisioning profile and requested entitlements do not match
- 2. The provisioning profile predates a capability change
- 3. An entitlement was added manually
- 4. The App Group identifier is wrong
- 5. The bundle identifier changed
- 6. The development team is wrong
- 7. application-identifier is inconsistent
- 8. keychain-access-groups is inconsistent
- 9. aps-environment is incorrect
- 10. Associated Domains is not permitted by the profile
- 11. An iCloud container belongs to another application
- 12. An extension has invalid entitlements
- 13. Debug and Release use different entitlement files
- 14. An .xcconfig overrides CODE_SIGN_ENTITLEMENTS
- 15. CI uses an outdated provisioning profile
- 16. A script modifies entitlements during the build
- 17. A wildcard App ID is used for a capability that requires an explicit App ID
- 18. A managed capability has not been granted
- What to check first
- Solution 1: Enable automatic signing
- Solution 2: Remove and re-add the capability
- Solution 3: Verify App ID capabilities in the Developer portal
- Solution 4: Regenerate the provisioning profile
- Solution 5: Make Xcode use the new profile
- Solution 6: Remove unnecessary entitlements
- Solution 7: Avoid unnecessary manual entitlement editing
- Solution 8: Correct App Group identifiers
- Solution 9: Configure Push Notifications through Signing & Capabilities
- Solution 10: Do not unnecessarily hard-code aps-environment
- Solution 11: Configure Associated Domains correctly
- Solution 12: Check Keychain Sharing
- Solution 13: Match the bundle identifier
- Solution 14: Match the development team
- Solution 15: Compare Debug and Release
- Solution 16: If only Archive fails, inspect Release
- Solution 17: Check every extension separately
- Solution 18: Decode the provisioning profile
- Solution 19: Inspect the entitlements actually signed into the app
- Solution 20: Compare the profile with the signed application
- Solution 21: Inspect embedded.mobileprovision from the archive
- Solution 22: Check application-identifier
- Solution 23: Update CI provisioning profiles
- Solution 24: Check CI entitlement settings
- Solution 25: Inspect resolved signing settings with xcodebuild
- Solution 26: Refresh stale local provisioning profiles
- Solution 27: Do not rewrite entitlements during the build
- Solution 28: Use configuration-specific entitlement files
- Solution 29: Replace wildcard App IDs when necessary
- Solution 30: Verify managed-capability approval
- If the error involves App Groups
- If the error involves Push Notifications
- If the error involves Associated Domains
- If the error involves Keychain Sharing
- If the error involves iCloud
- If the app installs in Simulator but not on a device
- If Debug succeeds but Archive fails
- If local builds work but CI fails
- Will Clean Build Folder fix it?
- Should you delete DerivedData?
- What you should avoid
- Fast troubleshooting checklist
- Summary
What does “signed with invalid entitlements” mean?
Entitlements describe special capabilities granted to an application through code signing.
For example, App Groups may appear as:
<key>com.apple.security.application-groups</key> <array> <string>group.com.example.myapp</string> </array>
Push Notifications involve:
aps-environment
The application can request only entitlements permitted by the signing profile.
If the app requests:
group.com.example.myapp
but the profile authorizes another group, the signed entitlement configuration is not valid.
Important: Adding a key to an .entitlements file does not grant that capability. The App ID and provisioning profile must authorize it as well.
Common situations where this error appears
- After adding App Groups
- After enabling Push Notifications
- After adding Associated Domains
- After enabling Keychain Sharing
- After changing iCloud configuration
- After enabling Sign in with Apple
- After manually editing an .entitlements file
- After switching from automatic to manual signing
- After changing the bundle identifier
- After changing the development team
- When using an old provisioning profile
- When an extension uses a stale profile
- When Debug works but Archive fails
- When local builds work but CI fails
- When only Ad Hoc or distribution signing fails
Common causes
1. The provisioning profile and requested entitlements do not match
For example, the app requests:
com.apple.security.application-groups = [ group.com.example.myapp ]
while the profile allows:
com.apple.security.application-groups = [ group.com.example.other ]
2. The provisioning profile predates a capability change
A profile created before App Groups, Push Notifications, or another capability was enabled may not contain the required entitlement.
3. An entitlement was added manually
For example:
<key>com.apple.developer.associated-domains</key> <array> <string>applinks:example.com</string> </array>
may have been added without enabling Associated Domains for the App ID.
4. The App Group identifier is wrong
The application may request:
group.com.example.debug
while the App ID is associated with:
group.com.example.production
5. The bundle identifier changed
A profile for:
com.example.oldapp
should not be reused for:
com.example.newapp
6. The development team is wrong
A profile issued by another team can result in mismatched application identifiers, keychain groups, and other signing entitlements.
7. application-identifier is inconsistent
The signed entitlement commonly has a value resembling:
TEAMID.com.example.myapp
A different Team ID or bundle identifier indicates a signing mismatch.
8. keychain-access-groups is inconsistent
Apps using Keychain Sharing need access-group values compatible with the team and provisioning profile.
9. aps-environment is incorrect
Push-notification entitlements depend on the provisioning profile used for the signed build.
A manually hard-coded value such as:
<key>aps-environment</key> <string>development</string>
can create problems in distribution configurations if it does not match the signing assets.
10. Associated Domains is not permitted by the profile
The application requests:
com.apple.developer.associated-domains
but the App ID or provisioning profile does not support the capability.
11. An iCloud container belongs to another application
The iCloud container identifiers in the entitlements need to match the configuration associated with the App ID.
12. An extension has invalid entitlements
The main app and its widgets or other extensions are separate signed executables.
A valid main app does not compensate for an incorrectly signed extension.
13. Debug and Release use different entitlement files
Debug: MyApp-Debug.entitlements
Release:
MyApp.entitlements
The Release file may contain an old or invalid value.
14. An .xcconfig overrides CODE_SIGN_ENTITLEMENTS
CODE_SIGN_ENTITLEMENTS = Config/Old.entitlements
can cause Archive to use an unexpected file.
15. CI uses an outdated provisioning profile
Automatic signing may work locally while CI continues using a manually stored .mobileprovision file from an older capability configuration.
16. A script modifies entitlements during the build
PlistBuddy, sed, file-generation scripts, or other automation can change the values that Xcode eventually signs.
17. A wildcard App ID is used for a capability that requires an explicit App ID
A wildcard such as:
com.example.*
does not support every capability.
18. A managed capability has not been granted
Some capabilities require approval from Apple. Manually adding their entitlement keys does not bypass the provisioning requirement.
What to check first
1. Open Signing & Capabilities
Project → Target → Signing & Capabilities
Check:
- Team
- Bundle Identifier
- Automatically manage signing
- Enabled capabilities
2. Check Code Signing Entitlements
Search Build Settings for:
Code Signing Entitlements
The underlying setting is:
CODE_SIGN_ENTITLEMENTS
3. Identify the failing target
The error may originate from:
MyApp MyWidget ShareExtension NotificationService
rather than the main app target.
Solution 1: Enable automatic signing
When appropriate, enable:
Target → Signing & Capabilities → Automatically manage signing
Select the correct team and configure capabilities in the same tab.
Xcode can then manage compatible signing assets and provisioning profiles.
Solution 2: Remove and re-add the capability
For App Groups, for example, remove the capability and add it again with:
+ Capability → App Groups
With automatic signing, this can refresh the entitlement and provisioning configuration.
Solution 3: Verify App ID capabilities in the Developer portal
Open:
Certificates, Identifiers & Profiles → Identifiers → App ID
and confirm that the required capability is enabled for the correct bundle identifier.
Solution 4: Regenerate the provisioning profile
For manual signing, regenerate the profile after changing App ID services or capabilities.
Certificates, Identifiers & Profiles → Profiles → Profile → Edit → Generate
Solution 5: Make Xcode use the new profile
Download the regenerated profile and verify that the current configuration uses it.
If you specify a profile manually, inspect:
PROVISIONING_PROFILE_SPECIFIER
Solution 6: Remove unnecessary entitlements
If the application no longer uses a capability, remove the corresponding entitlement rather than expanding the profile unnecessarily.
Solution 7: Avoid unnecessary manual entitlement editing
For supported capabilities, first try:
Signing & Capabilities → + Capability
Xcode can add the appropriate entitlement keys and reduce configuration mistakes.
Solution 8: Correct App Group identifiers
<key>com.apple.security.application-groups</key> <array> <string>group.com.example.myapp</string> </array>
Verify that the exact same App Group is associated with the App ID.
Solution 9: Configure Push Notifications through Signing & Capabilities
Signing & Capabilities → + Capability → Push Notifications
For manual signing, update the App ID and regenerate the provisioning profile.
Solution 10: Do not unnecessarily hard-code aps-environment
Avoid manually forcing:
<key>aps-environment</key> <string>development</string>
without understanding the signing configuration.
Configure Push Notifications and use a compatible provisioning profile instead.
Solution 11: Configure Associated Domains correctly
Add Associated Domains from:
Signing & Capabilities → Associated Domains
and configure entries such as:
applinks:example.com
Solution 12: Check Keychain Sharing
Inspect:
keychain-access-groups
for incorrect team prefixes or access-group values.
Solution 13: Match the bundle identifier
Inspect:
PRODUCT_BUNDLE_IDENTIFIER
and make sure the profile corresponds to that App ID.
Solution 14: Match the development team
Check:
DEVELOPMENT_TEAM
against the team that owns the profile and App ID.
Solution 15: Compare Debug and Release
For each configuration, inspect:
- CODE_SIGN_STYLE
- CODE_SIGN_ENTITLEMENTS
- DEVELOPMENT_TEAM
- PROVISIONING_PROFILE_SPECIFIER
- PRODUCT_BUNDLE_IDENTIFIER
Solution 16: If only Archive fails, inspect Release
Open:
Product → Scheme → Edit Scheme → Archive
and verify the signing configuration used by that build configuration.
Solution 17: Check every extension separately
For each target, verify:
- Bundle Identifier
- Team
- Provisioning Profile
- CODE_SIGN_ENTITLEMENTS
- Signing & Capabilities
Solution 18: Decode the provisioning profile
security cms -D \ -i MyApp.mobileprovision \ > /tmp/profile.plist
Then display the permitted entitlements:
/usr/libexec/PlistBuddy \ -c "Print :Entitlements" \ /tmp/profile.plist
Solution 19: Inspect the entitlements actually signed into the app
codesign -d \ --entitlements :- \ /path/to/MyApp.app
This is often more useful than inspecting the source .entitlements file because it shows the final signed result.
Solution 20: Compare the profile with the signed application
Compare:
security cms -D -i MyApp.mobileprovision
codesign -d --entitlements :- MyApp.app
Pay particular attention to:
- application-identifier
- com.apple.developer.team-identifier
- keychain-access-groups
- com.apple.security.application-groups
- aps-environment
- com.apple.developer.associated-domains
Solution 21: Inspect embedded.mobileprovision from the archive
The app bundle in an archive normally contains:
MyApp.app/embedded.mobileprovision
Decode the actual embedded profile:
security cms -D \ -i /path/to/MyApp.app/embedded.mobileprovision \ > /tmp/embedded-profile.plist
This verifies which profile was truly used rather than which one you expected Xcode to use.
Solution 22: Check application-identifier
/usr/libexec/PlistBuddy \ -c "Print :Entitlements:application-identifier" \ /tmp/profile.plist
Verify that the team prefix and bundle identifier are correct.
Solution 23: Update CI provisioning profiles
If local builds work but CI fails, replace any stale .mobileprovision files stored in the CI environment.
If you use a signing-asset management system, verify that the latest regenerated profile has been published to it.
Solution 24: Check CI entitlement settings
A CI-specific .xcconfig may point:
CODE_SIGN_ENTITLEMENTS
to a different file from the local configuration.
Solution 25: Inspect resolved signing settings with xcodebuild
xcodebuild \ -project MyApp.xcodeproj \ -scheme MyApp \ -configuration Release \ -showBuildSettings | grep -E "CODE_SIGN|ENTITLEMENTS|PROVISIONING|DEVELOPMENT_TEAM|PRODUCT_BUNDLE_IDENTIFIER"
Solution 26: Refresh stale local provisioning profiles
If automatic signing appears to reuse an outdated profile, review the profiles under:
~/Library/MobileDevice/Provisioning Profiles/
and remove only unwanted profiles before rebuilding so Xcode can request an updated profile.
Warning: In a manually managed team environment, do not delete signing assets blindly. Confirm which profiles are required first.
Solution 27: Do not rewrite entitlements during the build
Avoid changing the active signing file during xcodebuild with commands such as:
/usr/libexec/PlistBuddy ... sed -i ... cp generated.entitlements MyApp.entitlements
Solution 28: Use configuration-specific entitlement files
For example:
MyApp-Debug.entitlements MyApp-Staging.entitlements MyApp-Release.entitlements
and select them through CODE_SIGN_ENTITLEMENTS rather than rewriting one source file.
Solution 29: Replace wildcard App IDs when necessary
Some capabilities require an explicit App ID such as:
com.example.myapp
rather than:
com.example.*
Solution 30: Verify managed-capability approval
Some capabilities require Apple approval before their entitlements can appear in an eligible provisioning profile.
Do not manually add such entitlement keys as a workaround for a capability that has not been granted to the App ID.
If the error involves App Groups
Check:
com.apple.security.application-groups
in this order:
- App Groups in Signing & Capabilities
- The group identifier in the source entitlements
- The App Group in the Developer portal
- The App ID-to-group association
- The regenerated provisioning profile
- The entitlements in the final code signature
If the error involves Push Notifications
Inspect:
aps-environment
Then:
- Enable Push Notifications in Signing & Capabilities.
- Enable Push Notifications for the App ID.
- Refresh or regenerate the provisioning profile.
- Sign a fresh build with the updated profile.
If the error involves Associated Domains
Inspect:
com.apple.developer.associated-domains
Configure the capability in Signing & Capabilities and update manual provisioning assets when necessary.
If the error involves Keychain Sharing
Compare:
keychain-access-groups
between the provisioning profile and the final signed application.
If the error involves iCloud
Check values such as:
- com.apple.developer.icloud-container-identifiers
- com.apple.developer.icloud-services
- com.apple.developer.ubiquity-kvstore-identifier
and verify that the containers, App ID, provisioning profile, and entitlements all belong to the intended application.
If the app installs in Simulator but not on a device
Simulator execution does not exercise the same provisioning requirements as a physical device.
For device-only failures, prioritize checking:
- The provisioning profile
- The development team
- The App ID
- The bundle identifier
- The final signed entitlements
If Debug succeeds but Archive fails
This commonly indicates a Release-specific signing mismatch.
Inspect the Archive configuration and compare its provisioning profile, CODE_SIGN_ENTITLEMENTS, team, and bundle identifier with Debug.
If local builds work but CI fails
Check for:
- An outdated CI provisioning profile
- A stale signing certificate
- A different Team ID
- A different bundle identifier
- A CI-specific .xcconfig
- A script that rewrites entitlements during the build
Will Clean Build Folder fix it?
Not when the signing assets or entitlements are genuinely incompatible.
You can run:
Product → Clean Build Folder
after fixing the signing configuration, but cleaning does not authorize an invalid entitlement.
Should you delete DerivedData?
If the signing configuration has already been corrected and stale build artifacts are suspected, you can try:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
as a secondary step.
It does not fix a provisioning profile that lacks the required entitlement.
What you should avoid
Do not blindly add the entitlement named by the error to your .entitlements file.
Adding more entitlements does not necessarily fix signing. In fact, requesting an entitlement that the provisioning profile does not authorize is a common cause of this error.
Also avoid manually hard-coding signing-generated values such as application identifiers or team identifiers unless you have a specific documented reason.
Fast troubleshooting checklist
- Identify the target reporting the error.
- Open Signing & Capabilities.
- Check automatic signing.
- Verify the Team.
- Verify the Bundle Identifier.
- Check CODE_SIGN_ENTITLEMENTS.
- Remove stale or unnecessary entitlement keys.
- Check App ID capabilities in the Developer portal.
- Regenerate the profile after capability changes.
- Verify App Group identifiers.
- Check Push Notifications.
- Check Associated Domains.
- Check every extension target.
- Decode the provisioning profile with security cms.
- Inspect the signed app with codesign.
- Compare the profile and signed entitlements.
- Compare Debug and Release.
- Replace stale CI profiles.
- Stop scripts from rewriting entitlements during the build.
- Create a fresh build or archive after fixing the configuration.
Summary
Xcode’s “signed with invalid entitlements” error means that the entitlements signed into the application are not valid for the App ID or provisioning profile used to sign the build.
Common causes include outdated provisioning profiles, manually added entitlement keys, mismatched App Group identifiers, incorrect teams or bundle identifiers, and incomplete Push Notifications, Associated Domains, Keychain Sharing, or iCloud configuration.
Start with Signing & Capabilities, the selected Team, the Bundle Identifier, and CODE_SIGN_ENTITLEMENTS.
With automatic signing, configure supported capabilities through Xcode and allow it to refresh provisioning assets. With manual signing, update the App ID configuration and regenerate the provisioning profile after capability changes.
If the cause is unclear, decode the provisioning profile with security cms and inspect the final application’s signed entitlements with codesign -d --entitlements :-. Comparing those two outputs is one of the most effective ways to identify the exact mismatch.
Clean Build Folder and DerivedData cleanup are secondary measures. The real fix is to align the app’s requested entitlements, App ID capabilities, provisioning profile, and final code signature.
