46

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?

1
  • Just had the same error with PhoneGap Build and the Notification plugin (because I was using Developer Cert which will not work with notifications). Anyway, solved by creating an AdHoc-distribution provisioning profile at developer.apple.com, then compiling in Phonegap Build with that+the distribution cert. But before, uninstall app from iPhone & remove related provisioning profiles from Settings>General>Profiles. Also see: community.phonegap.com/nitobi/topics/genericpush_ios_error Feb 28, 2013 at 10:54

10 Answers 10

48

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.

19

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

13

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

enter image description here

1
  • It worked for me! For Provisioning profile Developer and AdHoc. thanks. Jun 29, 2017 at 15:03
10

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.

3

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

0
1

I kept going through the process over and over again with one mistake... the Provisioning profile i kept on using was DEVELOPMENT this WILL NOT WORK

you NEED to use ADHOC provisioning profile

1
0

if you didn't write the original code and aren't 100% sure on how it works, make sure that you have it set up to receive the right type of push notification token. had a problem where the app i was working on was only set up tokens on a release build. it's worth a try if nothing else works and you think your code is set up properly -- find the steps online somewhere to do a ad-hoc build and try it

0

It'll work even with a development profile but if you add in APN (Apple Push Notifications) after the fact make sure to go into member center and open the provisioning profile again (my said invalid), just opening it and closing it made it valid again and then I updated my profiles in Xcode via settings and everything worked just fine.

0

In my case, I renamed the App. So the provisioning profile was generated for the old App-ID. All I had to do, was to change the App-ID and add an new provisioning profile with the new App-ID.

0

For IONIC USERS:-

CAUSE:- If you are running your app in iphone using "ionic run ios" then this will also cause the same problem. SOLUTION:- instead you must run your ios app using XCODE to install app into iphone.

SOLVED MY PROBLEM!!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.