15

I would install an application in my mobile phone by using Xcode but it was not installed with following an error message.

  • Error Message
    "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)"


  • Matters of Inquiry
    1. Why does the error message occur while I install the application?
    2. Would you mind if you can give me the solution of this problem?
brush51
  • 5,691
  • 6
  • 39
  • 73
Join
  • 161
  • 1
  • 2
  • 8

15 Answers15

29

Check if you are using Entitlement file in Build Setting > Code Signing Section. If yes, try deleting that file name.

Anuj Panwar
  • 683
  • 7
  • 10
  • This worked for me after trying lots of other solutions. Why do I need to do this though? Have entitlements been removed? – Matt__C Nov 02 '16 at 15:03
  • Thanks, an explanation as to how this works would be really helpful though. – James Mundy Dec 31 '16 at 17:49
  • 1
    This doesn't make sense to me either - removing the Entitlements.plist file worked, but the Entitlements.plist was blank. Sounds like a bug – Coruscate5 Mar 23 '17 at 16:29
12

You are using Entitlement file

The entitlements file defines certain capabilities of your app. Usually, the file is automatically generated by Xcode when you enable a capability for your app. You only need the file if you enable certain capabilities, e.g. Healthkit integration. If you'd like to use these features, you have to add it. Otherwise, Apple will reject your app.

To fix this

  • Go to the build settings of your target.
  • Make sure that you have "All" selected instead of "Basic"
  • Type "entitlements" into the search box
  • The result is the build setting where you can specify where your entitlements file is located
  • Remove them

You are using the wrong Provisioning Profile

A provisioning profile is a collection of digital entities that uniquely ties developers and devices to an authorized iPhone Development Team and enables a device to be used for testing. A Development Provisioning Profile must be installed on each device on which you wish to run your application code.

  • Go to Build Settings > Code Signing > Provisioning Profile
  • Select a development profile under Team

Please ensure that the Team in the project, target and tests are the same.

Bundle Identifier and App ID do not match

  • Go to the build settings of your target
  • Select Packaging and change your App ID to match the Bundle ID

Clear cache in Xcode

Command-Option-Shift-K to clean out the build folder. Even better, quit Xcode and clean out ~/Library/Developer/Xcode/DerivedData manually.

Jaseem Abbas
  • 5,028
  • 6
  • 48
  • 73
8

You are using wrong provisioning profile to build your app on devices make sure you are using right type of profile. I was using App Store Deployment profile to build on devices. Use ad-hoc profiles or development profiles to build on your devices.

Priyansh
  • 1,163
  • 11
  • 28
6

You are using the wrong Provisioning Profile i.e. Distribution for development. Go to Build Settings > Code Signing > Provisioning Profile and select a development profile.

fpg1503
  • 7,492
  • 6
  • 29
  • 49
5

Check the if your "Code Signing" configurations are same on "PROJECT>Build Settings" and "TARGETS>Build Settings".

Personnally, I use for both:

 - "Code Signing identity": iOS Developer 
 - "Provisioning Profile" : Automatic
David DUTOUR
  • 151
  • 1
  • 3
  • 7
5

Check your "Team" parameter at your targets. It should be the same for your project and tests.

Vlad
  • 3,465
  • 1
  • 31
  • 24
3

For me none of the above answers worked. I tried to remove every code signing certificate from Keychain and build the app. When I resolved all code signing related errors for my target I still had some of them in Tests target. It has been set by someone else from my team before. I just switched to iOS Developer, and the invalid entitlement error went away.

Timo
  • 41
  • 5
3

I was getting this problem after moving app from one account to another. I tried all the solutions given by others, those might be correct in other cases. But I fixed the problem by going File -> Workspace Settings -> Build System and choosing "Legacy Build System". I'm using XCode 10.3.

Vinner
  • 1,231
  • 1
  • 15
  • 16
1

I faced this problem and my problem was My Bundle Identifier and AppID was not matched. Please change your Bundle Identifier in Build Settings->Packaging like your AppID.

enter image description here

Evana
  • 1,754
  • 13
  • 12
0

Just goto Apple developer portal from where you have downloaded provisioning profile.

Select your profile click edit and check whether all certificates are selected or not.

In my case selecting all certificates and downloading that new profile solved the above mentioned issue.

ViruMax
  • 1,216
  • 3
  • 16
  • 41
0

Also make sure in your schema you have set "Build configuration" to the correct configuration, in most cases "Debug".

Manuel
  • 14,274
  • 6
  • 57
  • 130
0

I got this error when export the ipa with App Store provisioning wrongly during CI process. My intention was to export with Adhoc provisioning.

Cullen SUN
  • 3,517
  • 3
  • 32
  • 33
0

I had the same error. My problem was that I checked 'Enable HealthKit' in Entitlements.plist, but I did not enable HealthKit when I created the App Id.

In short, all entitlements in your app (Entitlements.plist file in your project) should be configured on the provisioning profile you use (Provisioning profile = app ID + certificate + information about devices your app can run on).

Drunken Daddy
  • 7,326
  • 14
  • 70
  • 104
0

Had the same problem that suddenly popped up in my project from one day to the next.

What fixed it for me was turning "Automatically manage signing" off and on again for both targets and making sure the right development team was selected once it was on again (defaults to none in my project).

Andreas
  • 656
  • 9
  • 7
-1

It could seems a easy solution but I solved updating my iPhone's iOS version.

All answers I have seen talk only about xcode update. It was strange because my old iOS version was iOS 13.3.3 and it worked on another iPhone with iOS 13.6. After updating to iOS 13.7 it worked.

E_net4
  • 27,810
  • 13
  • 101
  • 139
MrHim
  • 401
  • 4
  • 16