34

I am getting error:

The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016).

on DISTRIBUTION CERTIFICATE & PROVISIONING Profile. Earlier, I was able to install the build using distribution profile, But, now I am not able to do so. It gives above error.

Below is my entielement contents:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>keychain-access-groups</key>

<array>

<string>$(AppIdentifierPrefix)com.myapp.xyz</string>

</array>

</dict>

</plist>

I have enabled PushNotification in my appid.

From past 2-3 days, I have gone through many such post on stackoverflow and tried various solutions. But none of them has worked. Things I have done to resolve,

  1. Created a new cert and provisionf profiles
  2. Removed old certs from keychains and installed new ones
  3. Removed old provision profiles from system and installed new ones (Manully and automatically through Xcode->Preferences->account->view Details-> download all)
  4. Restareted XCode many times after removing certs adding new ones
  5. Clean and build project
  6. Cleared derived data
  7. Kept Provisioning profile on automatic (but it builds with developer provisioning profile, dont know why)

According to error, I have matched my provision profile Application services (as per my appID in developer portal) with build capabilites in XCode. But its not working. Does that .entitlements file has to do anything with "Build capabilites"? I tried removing .entitlementonce but no luck.

UPDATE: I created a new project, New appID (The default ones are enabled. In-app and game center) and new distribution provisioning profile. Still gives same error. :(

UPADTE 2: Adding image of keychainenter image description here

Cœur
  • 37,241
  • 25
  • 195
  • 267
JiteshW
  • 2,195
  • 4
  • 32
  • 61
  • Can you look this. It may help you. https://developer.apple.com/library/ios/technotes/tn2415/_index.html – Ramesh_T May 04 '16 at 07:19
  • Thanks Ramesh_T. Looking intot that. – JiteshW May 04 '16 at 08:26
  • Did your issue resolved with provided link? – Ramesh_T May 04 '16 at 10:28
  • No, I just created new appID (Just for testing. Only game center and In-App purcahse enabled by default) & new Distribution provisioning profile using my new appID. Used that appId & provisiong profile In project. Removed old entitlements file and path in build Settings.Restarted system too. But Stil same error. I m not sure but could it be a certificate issue? – JiteshW May 04 '16 at 10:52
  • Did you check that the WWDR cert is the new one? – matt May 04 '16 at 12:08
  • Yes Matt, its new one. – JiteshW May 04 '16 at 12:13
  • Can you show your entitlements for your project? Also, in your post it wasn't clear - Are you unable to install and run on a device? Are you unable to debug? Simply stating that it is not working is not sufficient. We would need to know what exactly is not working. Your sentence "arlier it used to work so I know it just installs the app & dosent allow to debug." isn't a clear statement. Consider rephrasing to make it more clear. – wottle May 04 '16 at 19:39
  • @wottle I am not able to install and run on a device. I have also added entitlements file. I also tried by making a simple Hello World project and used new appid and new provisioning profile. but that too didnt work. See my update for that. – JiteshW May 05 '16 at 05:11
  • @JiteshW I think this is issue which every iOS developer encountered at least once. I will suggest to avoid anything automatic. Set all Prov. Profiles and team manually. I have struggled a lot from automatic settings of Xcode. In order to help you wee need all your settings... team, signing identity, prov. profiles.... I would recommend to start from scratch again – David V May 06 '16 at 10:42
  • @IAmDav, I had started from scratch except creating a new distribution certificate, But, Couldnt solve. Should I revoke tht too? – JiteshW May 06 '16 at 11:57
  • @JiteshW I'm not sure is distribution certificate revoking will solve your problem. But I'm sure problem comes from automatic settings. – David V May 06 '16 at 13:21
  • @IAmDav I have done both things. Used automatic as well and simply keeping only 1 provisiong profile in system and using that. – JiteshW May 06 '16 at 13:44
  • JiteshW, actually the reason can be differ of this error, do u have a look on following answers http://stackoverflow.com/questions/5240801/the-entitlements-specified-profile-0xe8008016-error-ios-4-2 – David V May 06 '16 at 16:36
  • @IAmDav, Tried but no result :( – JiteshW May 10 '16 at 09:18
  • @JiteshW , do you added new capabilities by mistake? check this: http://stackoverflow.com/questions/22625785/entitlements-file-do-not-match-those-specified-in-your-provisioning-profile-0xe?rq=1 – David V May 10 '16 at 10:37
  • @IAmDav, No I have not added new capabilites. Also I tried most of the combination with capabilities, that too didnt work. See my Update in question, In which, I created a new project, new app id, new provisioning profile. That too didnt worked. – JiteshW May 10 '16 at 10:54
  • @JiteshW, Could you print screen your keychain public and private keys? and certificate, are they valid?? – David V May 10 '16 at 11:18
  • Do you have the Apple Push Notification certificate? And try to set the certificate and provision profile yourself - just to check that it's not a problem with the "automatic" choosing the wrong one – Witterquick May 10 '16 at 11:43
  • @Roee84, Yes I do have apple push notif certificate and I tried both option for setting provisiong profile. – JiteshW May 10 '16 at 12:51
  • @IAmDav, I have added keychain access image – JiteshW May 10 '16 at 13:15
  • @JiteshW click on each certificate, on header part of keychain app you will see "This certificate is valid" if everything is ok. Are certificates which you use valid? if not I will suggest delete all, and create from scratch – David V May 10 '16 at 13:19
  • Did you set the Push notifications at the capabilities? – Witterquick May 10 '16 at 13:26
  • @IAmDav, All keychain certificates are valid :) – JiteshW May 11 '16 at 05:39
  • @Roee84, Yes, I have set push notificaion at the capabilities. Infact I tried both. – JiteshW May 11 '16 at 05:40
  • Check the capabilities tab in xcode maybe their is an error there – Ahmad Ishfaq May 12 '16 at 22:20
  • Hi @JiteshW, did you resolve this issue? Just like you, I have tried everything but still couldn't get it to work. An update is greatly appreciated! Thanks!!! – SeaJelly Jul 08 '16 at 20:38
  • @SeaJelly, Actually I moved to some other project. But couldn't solve that issue. – JiteshW Jul 09 '16 at 17:18
  • Possible duplicate of [The entitlements specified...profile. (0xE8008016). Error iOS 4.2](https://stackoverflow.com/questions/5240801/the-entitlements-specified-profile-0xe8008016-error-ios-4-2) – Adela Toderici May 09 '18 at 17:58

4 Answers4

98

Look into the test target, the team should be the same in both the test target and the main target.

test target team

Error 0xe8008016 - Distribution certficate

Petter Friberg
  • 21,252
  • 9
  • 60
  • 109
Mici
  • 981
  • 6
  • 4
  • 12
    Awesome, unlike many other posts, this answer actually solved my problem. I was using different teams. Using the same on both targets fixed it. Thanks a lot, Mici! – Renato Back Dec 01 '16 at 01:16
  • 1
    I searched for 3 hours to find a solution to my problem, and this was it. Oh my goodness. – Jalada Jan 09 '17 at 18:55
  • I was using manual singing in the main target and the test target was using automatic. After **setting both target to automatic with the same team**, it worked again, thanks. – GabLeRoux Oct 03 '17 at 13:11
  • I feel like there needs to be a way that this answer pops up as a recommended site as soon as you start typing entitlements iOS in your browser search bar! – Xials Sep 04 '18 at 18:22
  • What is a Test target and what is a Main target? This answer is poorly explained. – Elmue Aug 01 '19 at 21:45
3

Issue is due to distribution provisioning profile try using development or Ad-Hoc provisioning,Hope it's work ,Good luck

DJ1
  • 936
  • 15
  • 29
  • 3
    Yes, development provisioning is wokring fine. But, I want build with distribution provisioning profile – JiteshW May 13 '16 at 13:05
0

In my case, before the build I have added a key ITSAppUsesNonExemptEncryption in Info.plist which may not included in the provisioning profile. After removing ITSAppUsesNonExemptEncryption from Info.plist I am able to build successfully.

Kishan Bharda
  • 5,446
  • 3
  • 30
  • 57
0

I had this issue, and it was due to the existing builds in TestFlight expiring, so it's worth checking the build you've installed hasn't expired before doing any further investigation.

fredrivett
  • 5,419
  • 3
  • 35
  • 48