[ios] The executable gets signed with invalid entitlements in Xcode

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

The executable was signed with invalid entitlement

It worked fine with Xcode 4.x. Anyone knows how to get rid of the error?

enter image description here

This question is related to ios xcode code-signing provisioning-profile

The answer is


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


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


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


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


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


All said above is correct, especially by Bartlomiej Semanczyk: 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.


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.


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


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!


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


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.


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.


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.


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


This could be due running wrong scheme as well.


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


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:)


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


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.


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.


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.


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.


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.


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.


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.


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.


Changing my target device from my physical phone to a simulator fixed it for me!


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.


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

Change can be made from File/Project Settings. ERROR ITMS-90174: "Missing Provisioning Profile - iOS Apps must contain a provisioning profile in a file named embedded.mobileprovision."

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


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.


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.


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.


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


Restarting Xcode was what worked for me.


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.


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


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

enter image description here


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


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


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


Examples related to ios

Adding a UISegmentedControl to UITableView Crop image to specified size and picture location Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Autoresize View When SubViews are Added Warp \ bend effect on a UIView? Speech input for visually impaired users without the need to tap the screen make UITableViewCell selectable only while editing Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Examples related to xcode

Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 iPhone is not available. Please reconnect the device Make a VStack fill the width of the screen in SwiftUI error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65 The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Xcode 10: A valid provisioning profile for this executable was not found Xcode 10, Command CodeSign failed with a nonzero exit code

Examples related to code-signing

Xcode error: Code signing is required for product type 'Application' in SDK 'iOS 10.0' Code signing is required for product type 'Application' in SDK 'iOS 10.0' - StickerPackExtension requires a development team error Xcode 7 error: "Missing iOS Distribution signing identity for ..." The executable gets signed with invalid entitlements in Xcode iOS 7.0 No code signing identities found “Unable to find manifest signing certificate in the certificate store” - even when add new key Code signing is required for product type 'Application' in SDK 'iOS5.1' Why is my locally-created script not allowed to run under the RemoteSigned execution policy? The entitlements specified...profile. (0xE8008016). Error iOS 4.2 Xcode 'CodeSign error: code signing is required'

Examples related to provisioning-profile

No signing certificate "iOS Distribution" found Xcode 8 shows error that provisioning profile doesn't include signing certificate Code signing is required for product type 'Application' in SDK 'iOS 10.0' - StickerPackExtension requires a development team error Xcode 7.2 no matching provisioning profiles found How to remove provisioning profiles from Xcode An App ID with Identifier '' is not available. Please enter a different string The executable gets signed with invalid entitlements in Xcode Is there a way since (iOS 7's release) to get the UDID without using iTunes on a PC/Mac? Find provisioning profile in Xcode 5 Xcode5 "No matching provisioning profiles found issue" (but good at xcode4)