PC パソコン

How to Fix “Provisioning Profile Doesn’t Match the Entitlements File” in Xcode

When building or archiving an app in Xcode, you may encounter a signing error such as:

Provisioning profile doesn't match the entitlements file's value for the application-identifier entitlement

This error means that the entitlements requested by your app do not match the permissions contained in the provisioning profile Xcode is using.

It commonly appears after changing the Bundle Identifier, adding capabilities such as Push Notifications, App Groups, Associated Domains, or iCloud, switching to manual signing, or continuing to use an outdated provisioning profile.

The fix is to make the target’s Signing & Capabilities settings, the App ID configuration, and the provisioning profile agree with each other.

What this error means

Entitlements describe special permissions and capabilities granted to an app.

Common examples include:

  • Push Notifications
  • App Groups
  • Associated Domains
  • iCloud
  • Sign in with Apple
  • Keychain Sharing
  • Game Center

The provisioning profile also contains information describing which entitlements are permitted for the app’s App ID.

If the entitlements Xcode attempts to sign into the app are incompatible with the provisioning profile, code signing fails.

Apple’s current documentation explains that capabilities added in Xcode configure the required entitlements and associated signing assets. :contentReference[oaicite:9]{index=9}

What is the application-identifier entitlement?

The application-identifier entitlement uniquely identifies the signed application.

It commonly has a value similar to:

ABCDE12345.com.example.myapp

The first part identifies the developer team, while the second part corresponds to the app’s Bundle Identifier.

If the target now uses:

com.example.newapp

but the provisioning profile was created for an older App ID, the application-identifier values may not match.

Common causes

1. The Bundle Identifier was changed

This is one of the most common causes.

For example, the app may originally have used:

com.example.oldapp

and later been changed to:

com.example.newapp

If Xcode still uses a provisioning profile for the original identifier, signing can fail.

2. A capability was added but the provisioning profile was not regenerated

Capabilities such as Push Notifications and App Groups change the entitlements required by the app.

Apple states that when an App ID’s capabilities are modified, provisioning profiles using that App ID can become invalid and need to be regenerated. :contentReference[oaicite:10]{index=10}

3. The capability is not enabled for the App ID

Adding a capability in Xcode is not sufficient in every manual-signing workflow. The corresponding App ID may also need to be configured to permit that capability.

4. Manual signing points to an old profile

Provisioning Profile Specifier or related build settings may still reference an outdated profile.

5. Multiple entitlements files exist

Debug, Release, the main app, and extensions may each reference different .entitlements files.

Xcode may therefore sign a target with an entitlement set you did not expect.

6. CODE_SIGN_ENTITLEMENTS points to the wrong file

An incorrect CODE_SIGN_ENTITLEMENTS path can cause the target to use another target’s entitlements or a stale file.

7. An extension target is outdated

The main app may be configured correctly while a Widget, Share Extension, or Notification Service Extension still uses an incompatible provisioning profile.

Typical situations where the error occurs

  • After changing the Bundle Identifier
  • After enabling Push Notifications
  • After enabling App Groups
  • After enabling Associated Domains
  • After enabling iCloud
  • After enabling Sign in with Apple
  • After switching from automatic to manual signing
  • After manually selecting a provisioning profile
  • After moving an older project to another Mac
  • When Debug works but Archive fails
  • After adding an app extension

What to check first

1. Check Signing & Capabilities

  1. Open the project in Xcode.
  2. Select the affected target.
  3. Open Signing & Capabilities.
  4. Check the Team.
  5. Check the Bundle Identifier.
  6. Review all enabled capabilities.
  7. Check the selected provisioning profile if using manual signing.

2. Check CODE_SIGN_ENTITLEMENTS

Search Build Settings for:

CODE_SIGN_ENTITLEMENTS

You can also inspect the resolved value from Terminal:

xcodebuild -showBuildSettings | grep CODE_SIGN_ENTITLEMENTS

Verify that the setting points to the correct .entitlements file for the current target.

Solution 1: Enable Automatically manage signing

If your workflow does not require manual signing, automatic signing is often the easiest solution.

  1. Select the affected target.
  2. Open Signing & Capabilities.
  3. Enable Automatically manage signing.
  4. Select the correct Team.
  5. Build again.

Apple states that in Xcode 15 and later, enabling capabilities can automatically add the required entitlement keys and create updated provisioning profiles when automatic signing is used. :contentReference[oaicite:11]{index=11}

Tip: Automatic signing greatly reduces the chance of stale entitlement and provisioning-profile combinations in normal development workflows.

Solution 2: Regenerate the provisioning profile

If you use manual signing, create a new provisioning profile that matches the current App ID and capabilities.

Typical workflow

  1. Open Certificates, Identifiers & Profiles.
  2. Select the affected App ID under Identifiers.
  3. Verify all required capabilities.
  4. Open Profiles.
  5. Create a new provisioning profile.
  6. Select the correct App ID.
  7. Select the required certificate.
  8. Select registered devices when applicable.
  9. Generate the profile.
  10. Install or refresh it in Xcode.

Apple’s current manual-development-profile workflow requires selecting the App ID, development certificate, and registered devices. :contentReference[oaicite:12]{index=12}

Solution 3: Verify the App ID capabilities

If a capability exists in Xcode but is not enabled for the App ID, the generated profile may not contain the required entitlement.

Open the App ID in Certificates, Identifiers & Profiles and compare its enabled capabilities with those configured in Xcode.

Apple notes that changing an App ID’s capabilities can invalidate provisioning profiles that use that App ID, requiring them to be regenerated. :contentReference[oaicite:13]{index=13}

Solution 4: Inspect the provisioning profile

You can decode a .mobileprovision file with:

security cms -D -i MyProfile.mobileprovision > profile.plist

Then inspect it:

plutil -p profile.plist

Useful values to check include:

  • ApplicationIdentifierPrefix
  • TeamIdentifier
  • Entitlements
  • application-identifier
  • com.apple.developer.team-identifier

Apple also documents the security cms command as a way to inspect provisioning-profile contents. :contentReference[oaicite:14]{index=14}

Solution 5: Inspect the entitlements signed into the app

You can inspect the entitlements actually embedded in a built app with codesign:

codesign -d --entitlements :- MyApp.app

For an extracted archive or Payload directory:

codesign -d --entitlements :- "Payload/MyApp.app"

Compare values such as application-identifier with the corresponding values in the provisioning profile.

Solution 6: Make the Bundle Identifier match

Compare the Bundle Identifier in Xcode with the App ID registered in the Apple Developer account.

Xcode:

com.example.myapp

App ID:

com.example.myapp

If they differ, correct the configuration so the signing assets belong to the same application identifier.

Warning: Do not casually change the Bundle Identifier of an app that is already distributed. It is a core part of the app’s identity.

Solution 7: Check the entitlements file

Open the target’s .entitlements file and look for stale or incorrect values.

For example, an App Groups entitlement may contain:

<key>com.apple.security.application-groups</key> <array> <string>group.com.example.myapp</string> </array>

If the group does not exist for the current team or App ID, update the configuration rather than leaving the stale value in place.

Solution 8: Remove and re-add the affected capability

If Xcode’s capability configuration and the .entitlements file are out of sync, removing and re-adding the affected capability can rebuild the configuration.

Apple documents this approach for some capabilities such as Game Center when the capability appears enabled but the expected entitlement is missing. :contentReference[oaicite:15]{index=15}

Important: Record existing capability settings before removing anything, especially for App Groups, Associated Domains, or other configurations with custom values.

Solution 9: Remove outdated provisioning profiles

If automatic signing keeps selecting an old local profile, inspect the cached provisioning profiles:

~/Library/MobileDevice/Provisioning Profiles/

List the directory with:

ls ~/Library/MobileDevice/Provisioning\ Profiles/

Back up anything important, remove obsolete profiles, and build again.

Apple specifically documents removing unwanted cached profiles and rebuilding as a way to make Xcode request a fresh provisioning profile under automatic signing. :contentReference[oaicite:16]{index=16}

Solution 10: Check every target

Do not limit troubleshooting to the main application target.

Also check:

  • Widget Extensions
  • Share Extensions
  • Notification Service Extensions
  • Watch apps
  • App Clips
  • Test targets

Each target can have its own Bundle Identifier, capabilities, entitlements, and provisioning profile.

Solution 11: Compare Debug and Release settings

If the app runs on a device but Archive fails, compare the effective signing configuration for Debug and Release.

xcodebuild -showBuildSettings -configuration Debug | grep -E "CODE_SIGN|PROVISIONING|PRODUCT_BUNDLE_IDENTIFIER"

xcodebuild -showBuildSettings -configuration Release | grep -E "CODE_SIGN|PROVISIONING|PRODUCT_BUNDLE_IDENTIFIER"

Pay attention to:

  • PRODUCT_BUNDLE_IDENTIFIER
  • CODE_SIGN_ENTITLEMENTS
  • PROVISIONING_PROFILE_SPECIFIER
  • DEVELOPMENT_TEAM
  • CODE_SIGN_STYLE

Solution 12: Clean build caches

After correcting the signing configuration, stale build artifacts can still cause confusing results.

Run:

Product → Clean Build Folder

If necessary, remove DerivedData:

rm -rf ~/Library/Developer/Xcode/DerivedData/*

Restart Xcode and build again.

If the issue involves App Groups

If this error started after enabling App Groups, verify that the capability exists both for the App ID and in the profile being used.

Apple’s current documentation notes that older macOS provisioning profiles may not contain authorization for App Group entitlements and that Xcode can obtain updated profiles when automatic signing is enabled. :contentReference[oaicite:17]{index=17}

If the error occurs only in CI

If local signing succeeds but GitHub Actions, Jenkins, Bitrise, or another CI system fails, the CI machine may be using an older provisioning profile.

Decode the profile in CI:

security cms -D -i MyProfile.mobileprovision > profile.plist plutil -p profile.plist

Then inspect the effective build configuration:

xcodebuild -showBuildSettings | grep -E "CODE_SIGN_ENTITLEMENTS|PRODUCT_BUNDLE_IDENTIFIER|PROVISIONING_PROFILE|DEVELOPMENT_TEAM"

If the CI secret or signing repository still contains an old .mobileprovision file, replace it with a profile generated for the current App ID and capabilities.

What you should not do

Do not remove entitlements blindly just to make the signing error disappear.

Removing Push Notifications, App Groups, Associated Domains, or other required entitlements may allow the app to build while silently breaking important functionality.

If the capability is required, fix the App ID and provisioning profile instead.

Fast troubleshooting checklist

  1. Verify the Team in Signing & Capabilities.
  2. Verify the Bundle Identifier.
  3. Review enabled capabilities.
  4. Check CODE_SIGN_ENTITLEMENTS.
  5. Enable automatic signing if your workflow permits it.
  6. Enable the required capabilities for the App ID.
  7. Regenerate the provisioning profile.
  8. Inspect the profile with security cms.
  9. Inspect the built app with codesign.
  10. Compare Debug and Release settings.
  11. Check every extension target.
  12. Remove stale profiles and rebuild caches.

Summary

The Xcode error “Provisioning profile doesn’t match the entitlements file” means that the entitlements requested by your application are incompatible with the provisioning profile used to sign it.

It is especially common after changing the Bundle Identifier or adding capabilities such as Push Notifications, App Groups, Associated Domains, or iCloud.

Start by checking Signing & Capabilities, the Bundle Identifier, and CODE_SIGN_ENTITLEMENTS. If automatic signing is available, letting Xcode regenerate the provisioning profile is often the quickest fix.

For manual signing, ensure that the required capabilities are enabled for the App ID, generate a fresh provisioning profile, and compare the profile’s entitlements with those actually signed into the application.