29

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....

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Anderson Katao
  • 291
  • 1
  • 3
  • 5

10 Answers10

45

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.

lostInTransit
  • 70,519
  • 61
  • 198
  • 274
  • well in my case I just had to accept a new agreement on developer account site and then it started to upload without problem – user924 Jun 17 '19 at 17:28
7

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 a@xyz.com 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
Ted
  • 22,696
  • 11
  • 95
  • 109
6

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.

codingFriend1
  • 6,487
  • 6
  • 45
  • 67
3

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.

Kunal Verma
  • 562
  • 4
  • 15
2

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.

Sreejit
  • 107
  • 1
  • 7
2

Target -> Capabilities

Make sure the Add the Push Notifications entitlement to your entitlements file shows a check mark under Push Notifications.

If it shows an error, than fix it.

enter image description here

Ashish
  • 2,977
  • 1
  • 14
  • 32
  • well in my case I just had to accept a new agreement on developer account site and then it started to upload without problem – user924 Jun 17 '19 at 17:29
2

I just Quit xcode and open it again resolved my issue. xcode (Version 11.7 (11E801a))

  • 1
    This worked for me. On restart, xcode installed some additional components. And by selecting Automatically manage signin, everything worked fine. Thanks !! – RKS Nov 02 '20 at 14:56
0

Make sure your project Bundle Identifier matches the App ID certificate at Developer portal.

Gustavo Vollbrecht
  • 3,188
  • 2
  • 19
  • 37
0

i added this to my entitlements.plist and it's done.

<key>aps-environment</key>
<string>production</string>
-2

I use "ionic package" and this work for me:

  1. Go to https://developer.apple.com/account/ios/identifier/bundle
  2. Edit "iOS App IDs" checking "Push Notifications"
  3. Go to https://developer.apple.com/account/ios/profile
  4. Regenerate and download app "iOS Provisioning Profiles"
  5. Resend ".mobileprovision" file to Certificates in ionic apps panel
  6. Work again "ionic package..." command