The executable gets signed with invalid entitlements in Xcode

IosXcodeCode SigningProvisioning Profile

Ios Problem Overview


I got this error with Xcode when I try to run the app on my device.

>The executable was signed with invalid entitlement

It worked fine with old Xcode Anyone knows how to get rid of the error?

enter image description here

Ios Solutions


Solution 1 - Ios

I grappled with this issue for an hour, and finally found a fix. Turned out the Development Team was different in ProjectTarget and ProjectTests.

Solution 2 - Ios

Restarting Xcode was what worked for me

Solution 3 - Ios

I found out the problem. The app I created on developer.apple.com does not include inter-app-audio. The project entitlements plist file on Xcode has inter-app-audio set to YES (by default). Once I changed the setting on my app configuration on developer.apple.com to enable the inter-app-audio. Then my app runs on my devices. I guess that is apple's new rule to make your app settings consistent on both developer.apple.com and your xcode project setting.

Solution 4 - Ios

I was able to fix this by toggling on/off "Game Center" entitlement in Xcode 5 :-)

Solution 5 - Ios

No solution worked for me until I've checked and set app Tests target to same provisioning profile as main app. Or if you are using automatic singing make sure you have same team selected in Tests target.

Solution 6 - Ios

For XCode 10, one may need to use the legacy build system

Change can be made from File/Project Settings. https://stackoverflow.com/questions/30972472/error-itms-90174-missing-provisioning-profile-ios-apps-must-contain-a-provis/52605878#52605878

A cordova / ionic annoucement: https://github.com/apache/cordova-ios/issues/407

Solution 7 - Ios

I think your problem lies because of the profile that you were using xCode4.6 and now you are using xCode5.

You need to refresh certificates/provisioning profiles via XCode > Preferences > Accounts

XCode > Preferences > Accounts > Click on your DEV ACCOUNT > View Details button (bottom right) > Signing Iden/PPs screen appears > hit Refresh.

Then choose again from build settings the correct profile and clean and build your project.

Hope this helps you.

Solution 8 - Ios

The solution for latest Xcode:

First you have to check what is enabled in your Member center for your specific AppID:

enter image description here

Then in your appropriate target in Xcode you have to enabled the same capabilities: In this case: App Group, Game Center, In-App Purchase. All of them have to be enabled in your target in Xcode.

enter image description here

However it doesn't matter for DEBUG mode:

enter image description here

it very matters for your RELEASE mode: enter image description here

Note that Game Center and In-App Purchase are enabled by default in Member Center but are disabled in Xcode's target.

Solution 9 - Ios

I had to match the app's capabilities in Xcode5 under

Capabilities -> 
In-App purchase -> ON
Game Center -> ON

with that in the provisoning profile.

Solution 10 - Ios

xcode 6.1 (HealthKit sample)

I was getting this error due to HealthKit integration: I had enabled In-App Purchase, Game Center and Healkit solved my issue.. The same I have enabled in Provision profile.

enter image description here

enter image description here

Solution 11 - Ios

(Xcode 6.1)

The problem for me was in my Build Settings; I had my Provisioning Profile set to an App Store Production Profile when trying to deploy to a device. I switched it to 'Automatic' and it resolved my issue. You could also set it to your Dev Provision Profile.

I also have 2 Certificates, so I added my second Certificate to my dev provision. Others probably won't have this problem.

Solution 12 - Ios

I had a similar issue when I updated to Xcode 10, I solved the issue going to File > Project Setting, in the "New Build System" option select "Legacy Build System". This made the trick for me, I hope this helps to someone.

Solution 13 - Ios

Simple clean-and-build seemed to fix it for me.

Solution 14 - Ios

If this problem same me.You maybe forget set team in unittest in your target project try do this picture

enter image description here

Solution 15 - Ios

I solve this by deleting all "PROVISIONING_PROFILE=..." and "PROVISIONING_PROFILE[sdk=iphoneos*]" = ... in project.pbxproj and restart Xcode and set provisioning profiles for the target again.

Solution 16 - Ios

If restarting xcode doesn't work make a new provision profile and be sure to include your test devices.

Solution 17 - Ios

In my case, the device wasn't added. So I had to add the device and generate a new provisioning profile.

Solution 18 - Ios

Another thing to check - make sure you have the correct entities selected in both

> Targets -> Your Target -> Build Settings -> Signing

and

> Project -> Your Project -> Build Settings -> Code Signing Entity

I got this message when I had a full dev profile selected in one and a different (non-developer) Apple ID selected in the other, even with no entitlements requested in the app.

Solution 19 - Ios

This could be due to running distribution/release scheme. Changing the scheme to debug works for me. We can check the scheme here. Hope this helps someone.

enter image description here

enter image description here

Solution 20 - Ios

It seems to be a little bug inside Xcode. Try to archive it anyway, even there is a problem with entitlements. If your entitlements are fine, it will be uploaded without any problem. Apple accept it, and your app will be published to the AppStore.

I did it, and it worked:)

Solution 21 - Ios

This could be due running wrong scheme as well.

Solution 22 - Ios

I had the same problem in XCode 5. This helped me anyway.

XCode > Preferences > Location tab > DerivedData

Press a little left arrow to open DerivedData in Finder. Move to trash folder of your project and rebuild.

Screenshot

Solution 23 - Ios

Had some issue. Resolve: go to right target -> capabilities -> for me there was issue with "In-App Purchase" and button to fix it. Off-on operation fixed issue.

Solution 24 - Ios

In my case: I need enable Inter-App Audio in

Capabilities -> Inter-App Audio

I think because I use Parse.com Notification, it need link to AudioToolbox.framework

Solution 25 - Ios

Enabling Capabilities -> Inter-App Audio fixed this issue for me as well. I am also trying to send push notifications through parse

Solution 26 - Ios

The answers here seem a bit inadequate so I'm adding my two cents:

The real solution is that there is generally a mismatch between what is stored in your provisioning profile (check at developer.apple.com -> members -> certificates -> the cert you're using [be sure to check if dev/production) and what is enabled in your app (double click project name), under horizontal menu select'Capabilities' (next to 'General').

If you've recently changed one of these, be sure to refresh your certificates under XCode -> Preferences -> Accounts -> Details -> Refresh Icon and restart XCode.

Solution 27 - Ios

In my case APNS certificate is expired, remove the expired certificate and regenerate the provisioning profile fixes the issue.

Solution 28 - Ios

In my Case, i had to accept the Apple Developer License Agreement.

Login to apple developer account and observe the notification message similar to below.

"The Apple Developer Program License Agreement has been updated. In order to access certain membership resources,**** must accept the latest license agreement by June 28, 2016."

Earlier, i was not able to add/edit iCloud Containers to the App ID though i changed/checked Capabilities, Provisioning Profiles, Certificates etc. After agreement to the contract, things started working smoothly.

Hopefully, it would save someone's valuable time.

Solution 29 - Ios

I came across exactly the same issue quite recently. After reading many different advices which none of them worked for me, I finally went under the hood and found the root cause of the issue.

Mobile provisioning file actually DOESN'T match with the Entitlements file generated by Xcode.

Although all files are anaged automatically by Apple tool, they are not correct.

If you download provisioning file from Apple portal and open it (you can open it because it's just plist file signed by your certificate, so it's readable by text editor) and compare it with your Entitlements file (automatically generated by Xcode and residing in project files (so it's again plist XML file readable by text editor). Then you can see the difference.

In my case it was Game Center entitlement. It was displayed on the portal as checked (checked by default) but actually this entitlement was not included in mobile provisioning file. So it was matter of deleting it from Entitlements file.

So the result is - content of mobile provisioning profile sometimes doesn't match with what is displayed on the APP ID configuration page.

Solution 30 - Ios

For those who have the same problem with Provisioning Profile Automatic in the targets Build Settings:

Be very careful when you edit your targets entitlements file! This might break the correspondence to the automatically generated provisioning profile, and you will get this error.

In my case, I had to use temporarily the iCloud production containers with debug builds. To do so, I inserted

<key>com.apple.developer.icloud-container-environment</key>
<string>Production</string>  

in the entitlements file and this worked!
To remind me that I had later to remove these lines, I further inserted simply the following comment:

<key>TODO</key>
<string>The entry below must be out commented or deleted to use the iCloud development environment.</string>  

And this broke the correspondence, and created the error.

Solution 31 - Ios

I'm using Push notification in my app and after development completed i was try to test push notification for release configuration. At that time i got this error.

I was using Production Provisioning Profile to run for release. So i was able to solve this error by using Adhoc Provisioning Profile.

Solution 32 - Ios

The error message from xcode app installation sometime can be very misleading, I have aligned the entitlements many times, but the root cause is not because of that, it is because I have changed the certificate and my build pipeline script was using wrong certificate SHA value:

/usr/bin/codesign --force --sign 701BB03735D5960C855D6E79223414F93F40065E --entitlements $workspace/xxx.app.xcent --timestamp=none $workspace/xxxx.app

for my case, nothing's wrong with my entitlement file, it is because 701BB03735D5960C855D6E79223414F93F40065E is wrong, but the error message always print out as The executable was signed with invalid entitlements. Wasted my whole day for this.

Solution 33 - Ios

I faced same issue. For me solution was below steps.

  1. I went on developer account i uploaded push certificate in App Identifier.
  2. Regenerate provisioning profile

Conclusion: If there is any service enabled but it's not configured then eigther disabling or configuring that service might solve the problem

Solution 34 - Ios

If the other good answers listed here aren't working for you, try opening Keychain Access and removing all 'iPhone Developer...' certificates other than the primary one you're using for code signing. I found that I had several revoked certificates, and certificates from my other teammates that needed to be deleted.

Solution 35 - Ios

(Xcode 7.3.1) I had this issue with only one device in particular. What fixed it for me was to run the app from a colleague's computer(successfully) and after that I stopped getting this error on my computer.

Solution 36 - Ios

First and foremost make sure the correct provisioning profile is selected for the configuration that you have selected before building if you have manually set the provisioning profile. If you have set automatic as your provisioning profile make sure the correct provisioning profile is being picked up by Xcode while building.

Solution 37 - Ios

All said above is correct, especially by Bartłomiej Semańczyk: re-recheck entitlements settings in Dev Center AND in your project.

my two cents for Xcode 9/ iOS 11..

If You add new entitlements for NFC (valid only for iOS11 / Xcode 9) in your repo where you also have an Xcode 8 project, Xcode 8 WILL fail.

So in case you use multiple projects with the same base code (with conditional compilation) sharing the same non-code files, be SURE to differentiate entitlements files between different Xcode version.

Solution 38 - Ios

I was getting a similar error in Xcode 8.3.2. In my case, I found that removing the cached provisioning profiles from ~/Library/MobileDevice/Provisioning Profiles made Xcode download the correct one from the Developer Portal again and thereafter it worked first time. Hope this helps someone else!

Solution 39 - Ios

I simply went to apple dev portal, downloaded the appropriate provisioning profile and reinstalled it (xcode 10.1)

Solution 40 - Ios

Even if it could seems an easy fix, i solved it updating my iphone' s ios version. EDIT because of downvote: all answers i have seen talk only about xcode update. It was strange because of 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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEmmyView Question on Stackoverflow
Solution 1 - IosKrish WadhwanaView Answer on Stackoverflow
Solution 2 - IosRafa de KingView Answer on Stackoverflow
Solution 3 - IosEmmyView Answer on Stackoverflow
Solution 4 - IosNikView Answer on Stackoverflow
Solution 5 - IosMatej UkmarView Answer on Stackoverflow
Solution 6 - IosChen XingView Answer on Stackoverflow
Solution 7 - IosManthanView Answer on Stackoverflow
Solution 8 - IosBartłomiej SemańczykView Answer on Stackoverflow
Solution 9 - IosNithin HaridasView Answer on Stackoverflow
Solution 10 - IosVinod JoshiView Answer on Stackoverflow
Solution 11 - IosIan NewlandView Answer on Stackoverflow
Solution 12 - IosJose RojasView Answer on Stackoverflow
Solution 13 - IosMaxwellView Answer on Stackoverflow
Solution 14 - IosPapon SmcView Answer on Stackoverflow
Solution 15 - IosBabyPandaView Answer on Stackoverflow
Solution 16 - Iosmohammad alabidView Answer on Stackoverflow
Solution 17 - IosXavi ValeroView Answer on Stackoverflow
Solution 18 - IosCupawnTaeView Answer on Stackoverflow
Solution 19 - IosiGWView Answer on Stackoverflow
Solution 20 - IosBartłomiej SemańczykView Answer on Stackoverflow
Solution 21 - IosSaurabh BishtView Answer on Stackoverflow
Solution 22 - IosKrešimir PrcelaView Answer on Stackoverflow
Solution 23 - IosAnton PlebanovichView Answer on Stackoverflow
Solution 24 - IosNguyen TranView Answer on Stackoverflow
Solution 25 - IosjstnView Answer on Stackoverflow
Solution 26 - IosjderoView Answer on Stackoverflow
Solution 27 - IosBillChanView Answer on Stackoverflow
Solution 28 - IosDanbozView Answer on Stackoverflow
Solution 29 - IosRadekView Answer on Stackoverflow
Solution 30 - IosReinhard MännerView Answer on Stackoverflow
Solution 31 - IosMD.View Answer on Stackoverflow
Solution 32 - IosSam YCView Answer on Stackoverflow
Solution 33 - IosAmit SaxenaView Answer on Stackoverflow
Solution 34 - IosSmeedgeView Answer on Stackoverflow
Solution 35 - Iose1985View Answer on Stackoverflow
Solution 36 - IosIshaan SejwalView Answer on Stackoverflow
Solution 37 - IosingcontiView Answer on Stackoverflow
Solution 38 - IoswebmarinerView Answer on Stackoverflow
Solution 39 - IosDaniel LizikView Answer on Stackoverflow
Solution 40 - IosMrHimView Answer on Stackoverflow