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 work
If this problem same me.You maybe forget set team in unittest in your target project try do this picture
Simple clean-and-build seemed to fix it for me.
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 APNS certificate is expired, remove the expired certificate and regenerate the provisioning profile fixes the issue.
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.
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.