Xcode 8.1 "Provisioning profile doesn't include the aps-environment entitlement"

43,538

Solution 1

Check the Capabilities tab on your target and make sure the Add the Push Notifications entitlement to your entitlements file shows a check mark (under Push Notifications). If it shows an error, fix and you should be good to go.

Solution 2

For my case, Xcode 9

Case 1:

I used fastlane match before I added push notification capability and entitlement file.

Solution 1:

Run fastlane match again. It will detect that the provisioning profile is no longer valid since you added capabilities and will regenerate again, and push to your repo.

Case 2:

I used fastlane match before I added push notification capability and entitlement file.

I regenerated the invalid provisioning profile in the developer.apple.com account manually. So when I ran match, I got error

Provisioning profile '4d89b10f-568e-400d-a4e9-c96e0a51fd46' is not available on the Developer Portal for the user [email protected] Make sure to use the same user and team every time you run 'match' for this Git repository. This might be caused by deleting the provisioning profile on the Dev Portal

this may also happen when you press Fix Issue from Xcode

Solution 2:

Step1: delete the invalid provisioning profile from your certificates repo enter image description here Step2: run

fastlane match

Solution 3

It can happen that you have two entries for the "Apple Push Notifications Service" in your Entitlements file. This seems to be a bug in XCode (even in v8.2), which it cannot resolve by itself.

Open your Entitlements file in the text editor of your choice.

I had the following duplicate entries in my Entitlements file:

<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.aps-environment</key>
<string>development</string>

Try deleting one of the two key-value pairs. For me, deleting the first entry aps-environment solved the issue.

Solution 4

When you add push notifications to your app.

If you already have a provisioning profile.

It will become invalid.

You have to go to developer.apple.com

Edit your provisioning profile.

Then download the newly created one and double click on the same.

XCode will automatically replace the last one which became invalid.

Solution 5

Also verify that the apple id that you created on the Developer portal (developer.apple.com) has Push Notifications enabled. I faced it when I created the provisioning profile before enabling push notification on the app id so I had to edit the app id.

Share:
43,538
Admin
Author by

Admin

Updated on September 08, 2020

Comments

  • Admin
    Admin over 3 years

    Is anyone experiencing this problem?

    After persistence problemas and information retrieval on the KeyChain I had enable the KeyChain Sharing feature in Capabilities. This was to create a file called .entitlements

    So, when I gonna run the Archive this error occurs:

    Check Dependencies:  
    Provisioning profile doesn't include the aps-environment entitlement.  
    Code signing is required for product type 'Application' in SDK 'iOS 10.1'
    

    I'm using OS El Capitan 10.11.6, Xcode 8.1

    If anyone can help.

    Pleaseeee....