No valid 'aps-environment' entitlement string found for application on app store

96,726

Solution 1

I fix this problem by enabling push notification capability.

Click on .xcodeproj -> Capabilities -> Enable Push Notification

Solution 2

I fixed this issue like this:

  • Go to Xcode "Preferences"
  • Go to "Accounts" tab
  • Select my Apple ID and click "View Details"
  • Click on the arrow on the bottom left corner to refresh
  • Click "Done"

And try again!

Source:

Solution 3

You must have to enable Target—> capabilities—> push notification. I have faced this issue using Xcode 8. enter image description here

Solution 4

Such problems are due to current Provisioning Profile does not contain APNS information, as the Provisioning Profile is created BEFORE creating the APNS certificate.

Therefore, to solve the problem, create a new Provisioning Profile & select the Provisioning Profile in Xcode. Then you are DONE.

Also, when you add push, I believe you have updated the certificates in keychain too.

Solution 5

Navigation for adding push notification capabilities has changed slightly on higher versions of Xcode. Here using 12.2

Xcode 12 add notifications capabilities instructions

Share:
96,726
Jessiah
Author by

Jessiah

Updated on January 11, 2021

Comments

  • Jessiah
    Jessiah over 3 years

    So I have this app called Dripper that I put out about a month ago and then an update a couple days ago. The update added push notifications and a few little tweaks. I tested it with the sandbox-apn using the development profile and things worked great. Then I switched things to the production-apn and pushed it to test-flight, again things worked perfectly. Once I put update on the market and ran it I noticed I wasn’t getting any new push registrations on the server. I looked at the console logs for the device and found this:

    Dec 4 17:55:15 Ina-touch-it coffco[1210] : Registering for remote notifications
    Dec 4 17:55:15 Ina-touch-it SpringBoard[52] : No valid 'aps-environment' entitlement string found for application 'Dripper': (null). Notifications will not be delivered.
    Dec 4 17:55:15 Ina-touch-it coffco[1210] <Warning>: Failed to register with error : Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x174270900 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}

    I am a bit confused because I thought that the production-apn would function the same between ad-hoc and app store builds.

    Here is my app id and its entitlements:

    enter image description here

    Here is the provisioning profile for the apps store:

    enter image description here

  • Jessiah
    Jessiah over 9 years
    The profile that I am using was created after I created the certificate for the production push apn. Is there something I can do to confirm that it is missing or contains the apns info?
  • Hashem Aboonajmi
    Hashem Aboonajmi about 9 years
    then you should select correct provisioning profile in Build Setting
  • blackjacx
    blackjacx about 8 years
    In my case I needed to regenerate the provisioning profiles in the dev center. Then download all profiles and certificates again through Xcode > preferences > Accounts > Your Apple ID > view details button in the right corner > download all button. After that it should work again.
  • Pellet
    Pellet almost 8 years
    In XCode 8 I saw an error in this section saying an entitlements file needed to be added. I clicked on this to correct it and then it worked ok.
  • Kody R.
    Kody R. over 7 years
    Only recently popped up when starting to develop in Xcode 8 and this fixed it. Thanks!
  • Vinod Rathod
    Vinod Rathod over 7 years
    Was previously working on Xcode 7.3 but suddenly not registering on Xcode 8, but this solved my issue by enabling push notification capability.
  • Thomas Sebastian
    Thomas Sebastian over 7 years
    Apple decides to hide this option somewhere deep inside Xcode 8.1. Please let me know if anyone is able to find it.
  • Tom Pace
    Tom Pace over 7 years
    I find it sad there are so many glitches in the process of push and deployment. The only way I can tolerate any of this is to do 100% everything manually, and know what Xcode is attempting to do, and managing Keychain identities and provisioning profiles on file system and through iPhone Configuration Utility.
  • Max Mumford
    Max Mumford about 7 years
    I didn't get the "Push notification" option in the capabilities list. It was something to do with the fact that XCode was automatically generating my provisioning profile (I'm new to iOS dev so I might be wrong...). I had to sign into my developer account and manually create a provisioning profile for my app before it displayed Push Notifications in the capabilities list. Finally, enabling it fixed this issue.
  • Jabbar
    Jabbar about 3 years
    Have to add this for both Debug & Release in XCode 12.
  • Amjad Omari
    Amjad Omari about 2 years
    Thanks, you saved my ass, this solution fixed the issue
  • gadildafissh
    gadildafissh about 2 years
    This just resolved my issue with getting the error message. The app I'm supporting was built in Nativescript. So when I go to deploy I've been building in Navtivescript, then opening the build in XCode and following the normal steps to finish pushing up to Apple. So adding this config step will probably be something I have to do every time I push a new version, but at least it works!!!