"no valid aps-environment entitlement found for application"

41,725

Solution 1

I found the solution. In my project info under Build > Code Signing Identity I had it set to automatic, and it was selecting an AdHoc distribution profile which did not have push notifications enabled. (It was the wrong one.) I have selected the correct profile and the error is gone.

Solution 2

Push Notifications must be enabled for your App ID before creating a Provision Profile.

So, in this order:

Create your APP ID

Enable APNS

Create the Provisioning Profile

Solution 3

You have to enable Target—> capabilities—> push notification. I have faced this issue using Xcode 8.1.

enter image description here

Solution 4

In my case Xcode had invalidated the provisioning profile (it will say so in the Member Center).

What worked was to refresh all the provisioning profiles in Xcode after enabling Push for the app in the Member Center.

Here is Apples guide to refresh all the provisioning profiles on your computer. https://developer.apple.com/library/prerelease/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html#//apple_ref/doc/uid/TP40012582-CH30-SW26

In short open Xcode and do the following:

  1. In the Xcode Preferences window, click Accounts.

  2. Select your team, and click View Details.

  3. In the dialog that appears, click the Refresh button in the lower-left corner under the Provisioning Profiles table.

    Xcode updates the list of profiles in the Provisioning Profiles table.

Solution 5

Generate a Provision Profile specific for your App ID (Push Notifications Enabled), do not use the widlcard ones

Share:
41,725
Simon Woodside
Author by

Simon Woodside

Focused mainly on iOS and Rails. Founder of MedStack Founder of Monolith Apps Past Founder of Semacode Past Developer & Program Manager in Core OS at Apple University of Waterloo CS

Updated on July 09, 2022

Comments

  • Simon Woodside
    Simon Woodside almost 2 years

    I am encountering this error when I am loading an Ad Hoc build of my Push Notification enabled iPhone app onto my device:

    no valid aps-environment entitlement found for application

    What does it mean, and how do I repair it?

  • k06a
    k06a about 10 years
    This answer helps me! Thank you!
  • Pierre
    Pierre over 7 years
  • Rondinelli Morais
    Rondinelli Morais about 7 years
    It worked for me! For Provisioning profile Developer and AdHoc. thanks.