144

I am getting the 'dreaded' error The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016). when trying to deploy my first app to an un-jailbroken device on iOS 4.2.6 (Verizon). The thing is, I do not have a Entitlements file in my project, as I am not distributing it at all, only putting it on one device. I have gone through all the hoops and loops apple puts you through (certificate, device, provisioning) down to the letter, and I cannot figure out what is going wrong.

Can anyone please help me with this problem?

Richard J. Ross III
  • 55,009
  • 24
  • 135
  • 201
  • 15
    That's strange, I have a downvote. Would the person who did this please explain? – Richard J. Ross III Nov 04 '12 at 00:03
  • would suggest you to go through the following post. http://stackoverflow.com/questions/1410080/code-sign-error-with-xcode-3-2 http://discussions.apple.com/thread.jspa?threadID=2162558 – Jhaliya - Praveen Sharma Mar 09 '11 at 03:19
  • This *question* really helped me because it turned out that I *did* have an entitlements file (and you mentioning it made me aware of this). Removing the reference in `Build Settings > Code Signing > Code Signing Entitlements` allowed me to build this project. – Geoff Jul 30 '15 at 14:54

40 Answers40

65

Just came across this issue myself, the problem was that I had a Entitlements.plist file in the project as part of an ad hoc distribution, and its get-task-allow (ie. 'can be debugged') property was set to NO - setting this to YES fixed the issue and allowed the app to run from Xcode4 on the device in development.

Naturally need to set it back to NO for ad hoc distributions, but just thought I'd mention it in case anyone else comes across the same problem.

crafterm
  • 1,831
  • 19
  • 17
  • Thank you! That was killing me. – alan Nov 01 '11 at 06:59
  • "get-task-allow = NO" made my app see iCloud, when distributed as AdHoc ipa. – Tertium Sep 26 '12 at 18:53
  • 7
    By the way, check that you specify correct sign identity exactly in **Target -> Build Settings**, not in **Project**. **Target** overrides the **Project**. I've forgot about this and got 0xE8008016 error message. – Tertium Sep 26 '12 at 18:59
  • One more thing, if your app uses 'iCloud Key-Value Store' in the entitlements, you need to remove this key for the Debug version. Otherwise the app won't run on your device and will continue to give this error even if you have 'get-task-allow' set to YES. – strangetimes Apr 29 '15 at 13:43
  • Had to clean the project after changing that setting, but this worked like a charm. – Mike Jul 06 '15 at 18:46
  • This made my day so much easier. – Aleksander Azizi Jun 13 '16 at 23:48
50

I had this issue with Xcode 4.2.1.

For me it was nothing to do with Entitlements file, or Ad-hoc...

I was returning to and old project, and I'd forgotten to add my new iPhone to the provision.

Silly mistake, but also a silly corresponding error message... :-/

Snips
  • 6,575
  • 7
  • 40
  • 64
44

If you're using react-native, make sure that the Test target has the same provisioning profile as the main one.

Mohebifar
  • 3,341
  • 1
  • 24
  • 32
29

I've had this issue with the iCloud entitlements. My problem was that I forgot to enable iCloud for my App ID in the Provisioning Portal.

After enabling iCloud for your App ID, you will need to recreate the provisioning profiles.

adjwilli
  • 9,658
  • 4
  • 35
  • 29
  • 1
    I had this error happen to me again. I needed to add my new device to the development provisioning profile, then refresh the list in Xcode. – adjwilli Feb 16 '12 at 18:27
  • Had the same issue. Which is odd, because this app was enabled and working for ad-hoc deployment before. – raeldor Jan 14 '15 at 17:43
  • I had entitlements issue related to iCloud, as my app was accessing iCloud docs. I had to update iCloud entitlements in Capabilities section. – user3300864 Jul 05 '16 at 12:29
20

Keep your entitlements file in Target> Build Settings > Code Signing > Code Signing Entitlements.

Go to Target > Capabilities. Toggle On/Off or Off/On one of the capabilities.

Run.

ZpaceZombor
  • 877
  • 1
  • 10
  • 8
  • This worked for me. but again i have to select the provisioning profile in build setting page. – Rinku Jan 15 '15 at 09:41
  • 1
    This worked for me. Associated Domains was toggled on for me. I toggled it off and the problem was solved. – BigRon Jun 06 '15 at 19:28
19

What worked for me was to completely delete the entitlements file, from the groups list, and from the Build Settings in both Project and Target. Then I recreated the entitlements from the Summary tab in the target, and it loaded fine without any error messages.

Mark Knopper
  • 353
  • 4
  • 6
  • As stated above, Entitlement value must be deleted manually in Build Settings also – petershine Jun 25 '12 at 02:51
  • 1
    deleting the entitlements file and adding it again worked for me - i did a clean too – Jasper Jul 19 '12 at 11:27
  • This was my key here! I checked both the Project and Target Build Settings. In the Code Signing section there is a setting "Code Signing Entitlements" - I expanded, highlighted both the debug and release lines, and pressed Delete key. This then allowed my app to build without any errors. However, it still won't debug - it immediately exits with a message in the console, I will have to look it up. – Jay Imerman Jul 24 '12 at 20:04
  • 1
    This worked as well when trying to run the HealthKit "fit" app for iOS8 - there was an additional identifier string in the entitlements file. Removing it allowed the project to run after following other steps mentioned in this thread – Alex Stone Jul 17 '14 at 18:38
  • This fixed my issue with iCloud. Seems there were a couple of extra settings in the Entitlements file which didn't need to be there. Deleting them and all and having the General tab rebuild it worked. – AndyDunn Aug 31 '14 at 17:58
  • In my case, Xcode was saying the build on my device succeeded, when in reality nothing happened on the device. Validating an exported binary would fail with an error, though. Thanks so much for this! – Clifton Labrum Sep 21 '14 at 03:17
15

Just putting in my 5 cents here. For me none of the above worked, so I was forced to stress down and actually look at every part of the process with fresh eyes.

In rushing this I forgot that I was trying to install my app on a totally new device.

So my error was that I hadn't updated my provisioning profile by ticking off my new device int the "Devices" section of the provisioning profile setup in the Provisioning Portal.

Apparently not including your device in the provisioning profile also generates this error message.

PinkFloydRocks
  • 808
  • 3
  • 14
  • 29
12

None of the many answers fixed the 0xE8008016 Error for me.

But when I chose "Automatic Device Provisioning" in Xcode 4 > Organizer > Devices > Provisioning Profiles, it finally worked.

auco
  • 9,329
  • 4
  • 47
  • 54
  • 1
    That rocks! Worked for me too. I think it was a combination of all the above, since the app was originally developed with XCode 3, then brought up to 4.2, I removed the Entitlements.plist file from the project, deleted the code signing entitlements entry in the Build Settings/Code Signing section, then set the provisioning profile to automatic. That last one did it. – Jay Imerman Jul 24 '12 at 20:11
  • This was my problem too, except it was automatically selecting the wrong provisioning profile, and by manually selecting the correct one the issue is fixed. – Abhi Beckert Aug 10 '12 at 04:27
  • 1
    That did it for me. I am not sure how a few iOS Developer Team provisioning profiles got removed but clicking refresh in the Provisioning Profiles page you refer to resolved this error for me. – sean808080 Sep 12 '13 at 15:56
11

In my case it was a stupid mistake. I incorrectly set the "Run" scheme to use the "Distribution" build configuration instead of the "Debug" or "Release" one. Stupid mistake, but it took a while to debug it, so I'm going to add my answer to improve the knowledge base inside stack overflow!

viggio24
  • 12,316
  • 5
  • 41
  • 34
10

Delete your provisioning profiles, do a 'Clean All', make sure that your provisioning setting are correct, redownload, and try to run again.

W Dyson
  • 4,604
  • 4
  • 40
  • 68
  • What version of Xcode are you using? If it's 4.0, there have been problems with this. You may have to restart Xcode or even restart your Mac. Make sure that the provisioning settings are right in both the project and target. The target setting take precedence over the Project though. – W Dyson Mar 09 '11 at 03:20
  • I think its a problem with the device, its an iPhone 4 from Verizon, and with the same provisioning profile, I can deploy an app to my iPad.. has anyone else had this problem with an iPhone 4 from Verizon? – Richard J. Ross III Mar 09 '11 at 13:18
  • Are you using an old provisioning profile? You have to add the Verizon iPhone as a device in the Provisioning Portal and then update the development profile, re-download, and reinstall the new profile. If this doesn't work, you're going to have to provide more information. – W Dyson Mar 09 '11 at 13:22
  • I just set up the provisioning profile yesterday, how could it be old? apple just ratified my developer request, so It was brand new. Anyhow, I'll see how it works when we update to iOS 4.3 then. – Richard J. Ross III Mar 09 '11 at 14:31
  • A 'clean' did it for me. -_- – Cœur Dec 31 '13 at 10:33
5
  1. Open 'iOS Provisioning Portal' in Safari.
  2. Tap 'Devices' in the sidebar.
  3. Register your device's UDID
  4. Tap 'Provisioning Profiles'
  5. Edit your apps profile.
  6. Select the device your have just added.
  7. Download the .mobileprovision file.
  8. Install it.
  9. Build again.
neoneye
  • 50,398
  • 25
  • 166
  • 151
4

I had the same problem in my app, after a few month this specific app worked fine.

The problem was that the Capabilities configured in my Xcode project (under Targets -> {ProjectName} -> Capabilities) were not the same as the Capabilities configured in the provisioning profile (you can check that in the Apple member centre under Identifier -> App Ids -> {your app ID}. In the member centre I saw that Game Center is enabled and so in my project I also enabled Game Center. Then the app was able to launch.

I don't know how it worked until now. That's still a mystery :)

bobsacameno
  • 765
  • 3
  • 10
  • 25
  • I now realised that push notifications does not work anymore. I removed the Game centre capabilities in Xcode. The app now runs, but the push notifications are not coming anymore. Anyone knows why? – bobsacameno Jan 23 '15 at 18:02
4

For me check the "Automatically manage signing" option in Target solve the problem!

Carlos Jiménez
  • 148
  • 1
  • 9
3

If you didn't change anything related to certificates (didn't replace or update them) just do a Product -> Clean. It helped me several times. (Xcode 6.2)

nsinvocation
  • 7,559
  • 3
  • 41
  • 46
3

Upgrading to XCode 4 fixed the issue.

Brian Webster
  • 30,033
  • 48
  • 152
  • 225
Richard J. Ross III
  • 55,009
  • 24
  • 135
  • 201
  • 1
    Does not seem to be an XCode version specific issue, as I got the error in XCode 7.3.1. Had to delete the provisioning profile and redownload the same from XCode preferences to resolve the issue. – Ian Pinto Aug 11 '16 at 13:20
  • @IanPinto I agree. The main reason this is the accepted answer is because this is what worked for *me*. It's not really super useful information anymore, and I have upvoted most of the other answers in this post, as they all contain super valuable information for people looking at this in the future. The good thing about self-answers on SO is that they are not automatically pushed to the top of the stack, so not many people will see this answer, anyhow :) – Richard J. Ross III Aug 11 '16 at 19:06
3

Deleting the xcuserdata folder solved my issue. More on that here: https://stackoverflow.com/a/9968884/300694

Community
  • 1
  • 1
vinzenzweber
  • 3,379
  • 4
  • 24
  • 26
2

I ran into this problem today and I was pulling my hair out trying to figure it out. Like many people here, it would work if I removed the iCloud options in my entitlement file. When I would go to debug the app with the iCloud options enabled then I would get the 0xe8008016 error. This was right after revoking and regenerating new certificates.

So what solved it for me was to turn on iCloud support for the automatically generated Xcode team profile. Log onto the online provisioning tool, go to App IDs, click on Xcode iOS Wildcard App ID, click on edit, enable iCloud by checking the checkbox, and finally clicking Done. Refresh your profiles in Xcode and then it will start to work.

This makes some sense - when you're debugging it defaults to the team profile and the team profile needs to have iCloud turned on.

kurtzmarc
  • 3,110
  • 1
  • 24
  • 40
2

Happened to me when I was trying to use an app store distribution provisioning profile for local test by mistake. When I used the proper development profile it worked just fine. Maybe this helps somebody too.

Thomas Mondel
  • 1,944
  • 3
  • 20
  • 25
  • what can I do if I want to test the profile of the app that was uploaded to the App Store? Is there a way to do so? – bobsacameno Nov 14 '14 at 15:51
2

This worked for me...

  1. I deleted the Entitlements file from the target.
  2. Deleted the app off all my devices
  3. Cleaned the build in Xcode
  4. *optional delete the provisioning profile and re-add it

Hope it works for you guys too :)

Joe Barbour
  • 842
  • 9
  • 14
2

This is what solved my problem: Deleting the path in the Code Signing Entitlements section of the Targets build settings.

Jeremy Kelleher
  • 287
  • 3
  • 13
2

My provisioning profile from Apple developer matched my Xcode capabilities but it still wouldn't build onto my device until I did the following:

  1. Remove/Delete the entitlements file from your Xcode project.

  2. Go back to the Xcode capabilities tab

  3. Hit "Fix Issue" button to get Xcode to re-add the entitlements file.

Worked for me, hope it helps someone.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Henry Heleine
  • 673
  • 2
  • 9
  • 28
2

Happened to me on Xcode 8, it was partially caused by the new Provisioning Profile build setting, as in this Xcode version there are two entries for provisioning profile:

  • Provisioning Profile
  • Provisioning Profile (Deprecated)

My fault was that I updated only the first one, and the deprecated entry was still pointing to an invalid provisioning profile. Changing both to the same value solved the issue (clearing the deprecated entry should also have the same effect).

Cristik
  • 30,989
  • 25
  • 91
  • 127
1

In my case, it looks like Xcode (secretly) reset the Scheme. I found that the build configuration for Archive was set to Release instead of distribution one, and after I changed it to the correct one, it worked.

I think it is better to check the Schemes as well as the build settings.

YoonHo
  • 1,046
  • 9
  • 10
1

I had old project and same problem and I solved .

1.Go to summary
2.Summary have keychain groups and delete keychanin groups's object.

I hope it's will work for you . Regards.

Erhan Demirci
  • 4,173
  • 4
  • 36
  • 44
1

i'm using xcode 6 and encounter this issue for one particular iphone 4

finally , i go to device => provision profile =>

and then add the profile manually and problem is fixed .

chings228
  • 1,859
  • 24
  • 24
1

For me in Xcode 5.1 I was getting The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. when trying to test the app on my device. Device Development Certificate has to expire Feb 2015.

Issue was resolved:

Selected Target->Capabilities, under GameCenter, here I was getting error on GameCenter entitlement as it was not added to project, although first version of application was released via same XCode 5.1 but there were no errors like this before.

Below, a button was given with title Fix Issue. When clicked it added the GameCenter entitlement and issue was resolved.

After wards the screen looks like:

enter image description here

For me, there was nothing to do with certificate. App now runs successfully on the device.

MTahir
  • 1,173
  • 1
  • 13
  • 25
1

One more potential problem that will throw this error message: If you're using a perfectly valid provisioning profile for you main app, but have an expired or otherwise invalid provisioning profile for your Today widget extension. I imagine it'd be the same for an Apple watch extension as well.

Check all the profiles!

apb
  • 3,270
  • 3
  • 29
  • 23
1

Check KeyChain Access!

In my case I was using the wrong distribution certificate associated with the provisioning profile.

Daisy R.
  • 633
  • 1
  • 7
  • 19
1

The code I was working on had a different bundleid in the Info-plist than in the Product Bundle Identifier build setting.

I found this because I noticed this message in the device console in the devices view:

MIS: entitlement 'application-identifier' has value not permitted by provisioning profile 'iOS Team Provisioning Profile: com.xxx.yyy'

UglyBlueCat
  • 439
  • 1
  • 7
  • 22
0

If you are trying to activate iCloud syncing, you will need to enable iCloud for the AppID that is used to create the development provisioning profile (which Xcode does automatically). You'll also need to enable this for distribution profiles as well.

The tricky part is that when you refresh profiles in Xcode, this does not trigger a renewal of the profiles; they are simply re-downloaded. So in your iOS Provisioning Portal under Provisioning/Development, you'll need to check the profile that is labeled (Managed by Xcode) and delete it (Remove Selected button). Do this for ALL profiles, development & distribution, that you need to regenerate.

Now, in Xcode in the Organizer, delete provisioning profiles that you are about to replace.

Now to get new ones. If you develop for more than one team and only want to refresh a particular one, select the appropriate Team in the left pane under TEAMS, otherwise select Provisioning Profiles under LIBRARY, then select Refresh.

Finally, remove any old provisioning profiles on your device that could conflict with the new ones since profiles are never deleted automatically; newer profiles are simply added to the list.

Ryan H.
  • 7,374
  • 4
  • 39
  • 46
0

My problem was that the scheme was having Archive point to Release, and Release in the Build Settings had the Code Signing Identity set to the one of the automatic profile selectors. Well the "automatic" did the wrong thing (and in fact changed what it pointed to since two days ago), and was pointing to a different profile than the one I was selecting when creating the ad-hoc release. Pointing the identity to an explicit setting and using that same profile when distributing fixed the problem.

Lawrence Kesteloot
  • 4,149
  • 2
  • 31
  • 28
0

Check your entitlements against your app bundle id. It is probable it is not the same.

The way this still do not work is when I export for testing in my device but in Release mode.

That work to me.

CesareoAguirre
  • 1,557
  • 13
  • 11
0

If you have the certificate for Apple IOS Developer, there is no need to set value for key:"Code Signing Entitlements". Build Settings -> Code Signing Entitlements -> delete any value there.

  • This worked for me... probably not the *right* way to do it, but I just wanted to build my project. Thanks. – Geoff Jul 30 '15 at 14:56
0

I had the same problem as 'Snips' above - I forgot to add my phone to an updated dev provisioning profile! Just go to the provisioning portal, add your phone & then download the new profile. And agreed - the message you get isn't very helpful!

ViperMav
  • 71
  • 3
0

I fixed this by generating my provisioning profile again (and again).

Fogh
  • 1,275
  • 1
  • 21
  • 29
0

The issue for me was trying to sign the application with the app store distribution certificate. Switching the cert to the Xcode generated Team provisioning profile fixed the issue.

thst
  • 4,592
  • 1
  • 26
  • 40
0

This happened for me when I tried installing my app on a new device. I solved it by selecting Automatic for all of my Provisioning Profiles. After doing that and trying to install again, it now let me know that I just needed to add this new device to my profile, and gave me a Fix Issue button, which solved it.

Elijah
  • 8,381
  • 2
  • 55
  • 49
0

This seems to work for me when I encounter this:

  • Turn off all entitlements under Capabilities
  • Install app with a basic provisioning profile (no app groups, without push, no keychain sharing, etc)
  • Change the entitlements back and switch back to your proper provisioning profile. I undo the above changes using source control.

Flipping entitlements off/on alone didn't work for me—including uninstalling and reinstalling the app in between, deleting DerivedData, and restarting Xcode. It seemed I actually had to deploy the app in this configuration for it to go back to working properly.

I've had this issue several times when my provisioning profile gets updated and I reload it into Xcode. Nothing had changed with the entitlements allowed by the provisioning profile so everything should have matched as before. It may have worked to delete my entitlements file and recreate it as other uprooted answers suggest, from the Capabilities tab, too; but I use the above method to avoid random/no-op changes to my entitlements file that's checked into source control.

-1

I also encountered the same problem, I was such a solution.

First of all to be clear: provisioning profile must choose "Automatic" to debug.

If provisioning profile is "adhoc", then you can not debug, and can only export the ".ipa" file, import to iTunes for installation.

-2

These steps solved my problem:

  1. Go into organizer
  2. Devices
  3. select your device
  4. Delete the particular profile.
  5. Run again

Tada...

user739711
  • 1,842
  • 1
  • 25
  • 30