iOS build fails to register for APNs – “No valid aps-environment entitlement” (NSCocoaErrorDomain code 3000)

Troubleshooting

When I run my FlutterFlow iOS build (TestFlight), the app consistently fails to register for APNs.

The error from didFailToRegisterForRemoteNotificationsWithError is:

Error Domain=NSCocoaErrorDomain Code=3000 
"application does not have a valid 'aps-environment' entitlement"
UserInfo={NSLocalizedDescription=application does not have a valid 'aps-environment' entitlement}
  • My App ID on Apple Developer has Push Notifications enabled.

  • Provisioning profiles also contain aps-environment.

  • Runner.entitlements inside the exported project is correct.

However, in the generated Xcode project (project.pbxproj) the CODE_SIGN_ENTITLEMENTS setting is completely missing for the Runner target. Because of this, the entitlements file is not actually included in the final IPA signature, so APNs registration fails. (At least I think so)

I also tried building locally with Xcode, and when inspecting the IPA with codesign --entitlements, the aps-environment key is missing, confirming that the entitlement was stripped.

As a result, I cannot obtain an APNs token and the app always throws the NSCocoaErrorDomain 3000 error.

What have you tried so far?
  • Verified that Push Notifications are enabled in App ID.

  • Checked provisioning profiles – aps-environment is included.

  • Inspected Runner.entitlements – file is correct.

  • Forced re-register inside the app, still fails.

  • Built locally with Xcode to validate entitlements → same result, no aps-environment in the signed IPA.

  • I believe FlutterFlow’s cloud build is not attaching Runner.entitlements because CODE_SIGN_ENTITLEMENTS is not set in project.pbxproj.

Did you check FlutterFlow's Documentation for this topic?
Yes
3
5 replies