iOS app is rejected because the aps-environment entitlement is missing
the aps-environment entitlement is missing from the app's signatureShort answer
The app uses push notifications, but its code signature does not claim the aps-environment entitlement, or the provisioning profile does not allow it. Read the entitlements of the built app, then add the Push Notifications capability, enable push for the App ID, and regenerate the profile.
Fix it fast
1Find out which cause you have
Print the entitlements that are really in the built app. The result tells you whether the problem is in the target (nothing printed for aps-environment) or in the profile (the key is there, but signing or upload still fails).
codesign --display --entitlements - --xml MyApp.app | plutil -convert xml1 -o - -2Match what you see, then jump to its fix
- 1
The command above prints no aps-environment keyThe target never had the Push Notifications capabilityFix - 2
The capability is in the target, but nobody ticked Push Notifications on the App ID itselfPush notifications are not enabled for the App ID in the developer accountFix - 3
The App ID has push enabled and the target has the capability, but the profile you sign with was made before thatThe provisioning profile is older than the capability and does not allow the entitlementFix
- 1
What does the error look like?
the aps-environment entitlement is missing from the app's signaturedidFailToRegisterForRemoteNotificationsWithError is called and no device token arrives
Cause 1 of 3
The target never had the Push Notifications capability
1Check
Apple says you add the entitlements an app needs for push by enabling the Push Notifications capability in the Xcode project. Without it, nothing writes aps-environment into the signature.
codesign --display --entitlements - --xml MyApp.app | plutil -convert xml1 -o - - | grep -A1 "aps-environment"2Fix
Open the app target, go to Signing & Capabilities, and add Push Notifications. On a macOS target the same capability adds a different key, com.apple.developer.aps-environment.
# Xcode: target > Signing & Capabilities > + Capability > Push Notifications3Verify
Build again and print the entitlements: the key aps-environment is now there.
codesign --display --entitlements - --xml MyApp.app | plutil -convert xml1 -o - - | grep -A1 "aps-environment"Confirmed by developer.apple.com
Cause 2 of 3
Push notifications are not enabled for the App ID in the developer account
1Check
Apple's registration guide says that, besides the capability in Xcode, you must enable the push notification service for the App ID assigned to your project in your developer account.
# developer.apple.com > Account > Certificates, Identifiers & Profiles > Identifiers > your App ID2Fix
Edit the App ID, tick Push Notifications, and save. Confirm the warning dialog if one appears.
# Identifiers > select the App ID > Edit
# tick Push Notifications > Save (Confirm if asked)3Verify
Regenerate the profile (next cause), build again, and check that the signature contains aps-environment.
codesign --display --entitlements - --xml MyApp.app | plutil -convert xml1 -o - - | grep -A1 "aps-environment"Confirmed by developer.apple.com
Cause 3 of 3
The provisioning profile is older than the capability and does not allow the entitlement
1Check
A profile works as an allowlist: every entitlement the app claims must also be in the profile. Apple says profiles that contain a modified App ID become invalid. Open the profile and look for aps-environment in its Entitlements.
security cms -D -i Profile.mobileprovision -o Profile-payload.plist
plutil -extract Entitlements xml1 -o - Profile-payload.plist2Fix
Regenerate the provisioning profile that uses that App ID in the developer account, download the new one and build with it.
# developer.apple.com > Certificates, Identifiers & Profiles: regenerate the provisioning profile for this App ID, then download it3Verify
The same plutil command now lists aps-environment, and the build signs without an entitlement error.
security cms -D -i Profile.mobileprovision -o Profile-payload.plist
plutil -extract Entitlements xml1 -o - Profile-payload.plistConfirmed by developer.apple.com
How do I stop it coming back?
- Add the Push Notifications capability in the same change that adds the first call to registerForRemoteNotifications().
- After you change a capability for an App ID, regenerate every profile that uses it.
- Print the entitlements of the archived app before you upload, so a missing key is found on your Mac and not in a rejection.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Mobile apps
Cannot change the App Privacy answers in App Store Connect
Publish Your App Privacy Responses?
Only the Account Holder, Admin and App Manager roles can answer the App Privacy questions.
2 causes, each with a fixMobile apps
App record creation fails because you lack permission
You cannot add a new app in App Store Connect as a Developer or limited user
Only the Account Holder, an Admin or an App Manager can create an app record, and Apple blocks it until the Account Holder has signed the latest agreement.
3 causes, each with a fixMobile apps
You cannot find the button to pull your app back from review
No 'remove this version from review' message appears on the version page
There is no button called Reject Binary.
3 causes, each with a fixMobile apps
Your Apple Account cannot sign in to App Store Connect
Sign-in to App Store Connect is refused for an account that should have access
App Store Connect does not open to every Apple Account.
3 causes, each with a fixMobile apps
Apple rejected the app under Guideline 4.3, Design: Spam
Guideline 4.3(b) - Design - Spam
Guideline 4.3 is Apple's duplicate rule.
5 causes, each with a fixMobile apps
App Store Connect rejects a screenshot because it has transparency
Images can't include alpha channels or transparencies.
App Store Connect does not accept screenshots that carry an alpha channel or transparent pixels.
2 causes, each with a fix