“no valid aps-environment entitlement found for application”

前端 未结 10 1972
长情又很酷
长情又很酷 2021-01-31 15:01

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 entitle

相关标签:
10条回答
  • 2021-01-31 15:26

    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.

    0 讨论(0)
  • 2021-01-31 15:27

    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

    0 讨论(0)
  • 2021-01-31 15:27

    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.

    0 讨论(0)
  • 2021-01-31 15:27

    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 讨论(0)
  • 2021-01-31 15:30

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

    0 讨论(0)
  • 2021-01-31 15:37

    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 讨论(0)
提交回复
热议问题