How to fix “no valid 'aps-environment' entitlement string found for application” in Xcode 4.3?

前端 未结 23 1877
长情又很酷
长情又很酷 2020-11-27 10:43

I\'ve been trying very very hard to create a simple simple iOS app which can recieve push notifications. My only reason for doing this is to establish a procedure for some

相关标签:
23条回答
  • 2020-11-27 11:01

    This was what fixed it for me. (I had already tried toggling the capabilities on/off, recreating the provisioning profile, etc).

    In the Build Settings tab, in Code Signing Entitlements, my .entitlements file wasn't link for all sections. Once I added it to the Any SDK section, the error was resolved.

    0 讨论(0)
  • 2020-11-27 11:04

    If you created your provisioning profile before configuring the app ID for push, try to regenerate the provisioning profile.

    iOS Provisioning Portal -> Provisioning -> Your cert -> EDIT -> Make an edit -> Download new provisioning

    Worked for me. Now i'm able to use push.

    0 讨论(0)
  • 2020-11-27 11:04

    (Xcode 5) Well, after spending an hour I solved my issue. Even if you re-generate the provisioning file in Xcode 5, you should manually update your account. I only changed provisioning file in the Organizer tab that did not work, Xcode kept build with old provisioning file.

    So go to

    Xcode > Preferences > Accounts > View Details (Select your account)

    Then refresh your provisioning files.

    0 讨论(0)
  • 2020-11-27 11:05

    I had the same issue was everyone else and tried all the above tricks, nothing worked. I even deleted and started fresh with a different developer account.

    What worked for me in the end was

    1. Do as suggested above and create APP ID
    2. Then create provisioning profile
    3. DO NOT use the team wildcard profile (managed by xcode one) in the development section of the provisioning. You need to make a separate one using that app ID that you've made push notification active for. This way when you develop it will have the push notification function built in.

    I don't know if you can enable that for a wildcard app, but after trying at least 12 different suggestions and losing a few days I hope this helps someone

    0 讨论(0)
  • 2020-11-27 11:08

    My problem was simply that I was signing with the Xcode-managed wildcard provisioning profile.

    After I created an app-specific profile (and downloaded it, double-clicked it, and ensured my Build Settings referred to it), I successfully received an APNS device token.

    0 讨论(0)
  • 2020-11-27 11:09

    It took me hours to solve it. Given that someone is using custom scripts to sign and pack while others are using xcode itself, there's only one way to check what ended in your app. Dump you entitlements with

    codesign --display --entitlements :- path/to/MyApp.app

    and check aps-environment and application-identifier.

    0 讨论(0)
提交回复
热议问题