Xcode 4.3.1 "A valid provisioning profile for this executable was not found" - iphone

Tonight I upgraded from Snow Leopard to Lion, and upgraded to Xcode 4.3.1 (iOS 5.1). And now when I try and run debug mode on my device (iPad) I get "A valid provisioning profile for this executable was not found". I have tried every suggestion in past posts on this issue. I have generated a new certificate. I have set my code signing to use the new certificate. I have updated the provisioning profile to use the new certificate. I have gone into the .pbxproj file and deleted all references to the provisioning profile. I have cleaned and closed Xcode a million times. No matter what I do, I still get the same error when trying to run on the device.
In Organizer, the provisioning profile shows up as "Valid profile" in my Library, but under the Provisioning Profiles listed for the device there are none listed. I have tried clicking the Add button and importing it manually - nothing happens. It doesn't show up. When I click on the device icon in Organizer is says "Provisioning No provisioning profiles". However when I go to my iOS Provisioning Portal online and click on the device, the provisioning profile shows up there as being associated to the device.
Any ideas? I am pulling my hair out here.

Do you by chance have two developer accounts with different sets of devices/apps? I encountered this situation (see what "iOS Team Provisioning" profile is matching "iPhone Developer"). The only way I have found to switches teams, so to speak, is to select your device and click "Add to Portal" and log in with the correct Apple ID.

The solution that worked for me was:
-Deleted all references to provisioning profile in .pbxproj.
-Deleted all certificates in keychain.
-Imported my certificate to keychain.
-Created new provisioning profile and configured it in developer portal.
-Refreshed provisioning profiles in xcode organizer.
-Deleted the wildcard provisioning profile that xcode automatically adds.
-Went into code signing and selected the signing account associated to the correct provisioning profile.
-Plugged in a different iOS device (switched iPad with for fresh iPhone)
-Built for a new iOS device.
And it worked. Not sure which step was the magic one. I did not reinstall xcode.

Make sure there is a valid private and public key generated for the profile. More importantly make sure the keys are stored in the right place in keychain.
They should be under login, not system or any other spot. This was causing and issue for me, and it took me a while to find the solution.
Hope this helps.

I have seen this problem before, and my "standard" solution is
a) make a new dummy iOS project , using Xcode menu - file - new - project. Check code signing is your developer certificate. Compile and see if it can run on your iPhone/ipad hardware.
If a) fails, it is something with your certificates and keychain. Clear all and make new certificates
If b) works, it is something in the .xcodeproj file or build folder for your problem project. Remove all files and folders in build. Use your backup (sure you have a daily backup for your project!!!), and copy an "old" .xcodeproj file to your problem project. Use Xcode - project - clean, xcode - project - build as - testing , and hereafter "run".
Before trying above solution, make an extra backup.
good luck, and remember you are not the first having certificate problems.

In my case the problem was not at all related to keys, certificates, provisioning profiles or any other of the reasons mentioned here and everywhere else. It turns out that some other developer in a different team borrowed the iPad we use and changed the device's date to one year in the future! After I set the correct Date and Time and ran the application on the device everything worked just fine.
Unfortunately Xcode didn't warn me about this, and it was until I needed to fix another unrelated problem that Instruments informed me of this situation about the wrong date on the device.

Simply check "Code Signing" section in "Build Settings". If you previosly build your app for appstore publication maybe you forgot change from distribution profile to development profile.

If you are on Xcode 6, and running into this problem when adding a new device (iPhone 5/6), you can follow the steps here:
https://stackoverflow.com/questions/22993092/a-valid-provisioning-profile-for-this-executable-was-not-found-error-when-tryi/26153171#26153171

Related

Installing provisioning profile on device does nothing xcode 6

I have a valid provisioning profile, the program I'm running works fine on one of my iPhones. However, for some reason I cannot add it to my other iPhone. Here's how it looks:
Show provisioning profile
Click to add one
Select my provisioning profile
Aaaaaand nothing happens
Has anyone else experience a similar problem or does anyone know what might be the solution? As of just now it just seems that xcode is unresponsive.
Rkey, I had this same problem. If you haven't found a solution, this is how I solved mine.
Instead of trying to install a provisioning profile by yourself, run the app on the device without trying to set it up yourself. Now, if I'm not mistaken, you'll get the "no provisioning profile found for this executable" message or something like that.
You need to change the Code Signing Identities in the build settings of your Xcode6.
Change everything [Code signing identity, Debug, Any SDK, Any iOS SDK, Release, Any iOS SDK)to iOS Developer and set Provisioning Profile to Automatic.
After that, if you try to run the app on the phone again, the prompt will give you an option to "Fix Issue" and clicking on "fix issue" solves the problem.
Hope it works for you.
Go to apple portal and add all the required devices there.
Then go to the provisioning profile you want to download, edit it and make sure the following things:
The App ID associated with the provisioning profile and your App ID in the info.plist is the same.
All the required devices are included in this profile(they are checked marked for the profile).
Check the associated provisioning profile certificate is valid and you have a private key pair for that certificate.
In xcode settings select the provisioning profile and code signing
identity(the certifcate) for the scheme you are running the
application.
Updated answer for XCode 10 ...
See here: https://stackoverflow.com/a/52434756/3216970
Ran into this w/an Ionic app initially created w/XCode 9.
Absolutely none of the usual fixes for automatic/manual profiles or certificates worked.
The issue was with XCode 10's "new & improved" Build System. It just doesn't work w/older projects, and none of the error messages actually explain why.
Go to File -> Workspace Settings.
Change Build System to "Legacy Build System"
Now magically the Provisioning Profiles show up on your device and you can deploy the app you needed to get on a device 3 hours ago when you started messing with this provisioning BS for the umpteen-dozenth time. Thanks Apple.

Xcode 4 - "Valid signing identity not found" error on provisioning profiles on a new Macintosh install

I had a Macintosh I used to develop iPhone apps with using Xcode 4.
I now have a new Macintosh with a new install of... everything.
When opening Xcode projects built on the old Mac, I cannot run the app on the iPhone that was configured as a development iPhone.
Xcode 4 organizer tells me "Valid signing identity not found" on my provisioning profiles.
I guess this is something to do with the .certSigningRequest file I had generated before on the old Mac (I have a backup of that file), but what do I have to do with it on the new Mac?
Another strange thing, I don't see my 5 existing provisioning profiles (defined on Apple provisioning portal) in the organizer, even after a refresh and after having entered my provisioning portal login and password :
With Xcode 4.2 and later versions, including Xcode 4.6, there is a better way to migrate your entire developer profile to a new machine. On your existing machine, launch Xcode and do this:
Open the Organizer (Shift-Command-2).
Select the Devices tab.
Choose Developer Profile in the upper-left corner under LIBRARY, which may be under the heading library or under a heading called TEAMS.
Choose Export near the bottom left side of
the window. Xcode asks you to choose a file name and password.
Edit for Xcode 4.4:
With Xcode 4.4, at step 3 choose Provisioning Profiles under LIBRARY. Then select your provisioning profiles either with the mouse or Command-A.
Also, Apple is making improvements in the way they manage this aspect of Xcode, and some users have reported that the Refresh button in the lower-right corner does the trick. So try clicking Refresh first, and if that doesn't help, do the export/import sequence.
Picture for Xcode 4.6 added by WP
Edit for Xcode 5.0 or newer:
Open Xcode -> Preferences ('Command' + ',')
Select the Apple ID from the list.
Click on the SETTING icon near the bottom-left corner of window, and choose EXPORT ACCOUNTS... Xcode asks you to choose a file name and password.
On your new machine, launch Xcode and import the profile you exported above. Works like a charm.
Picture for Xcode 5.0 added by Ankur
I just run into the similar issue today. Unfortunately my HD died on me so I couldn't do the migration mentioned here in the accepted answer. I had to do the following steps:
Connect to the Apple Developer member center then the iOS
provisional portal.
Revoke my certificate.
Create a new certificate by providing a new pair of private and public key.
Remove all the previous provisioning profiles and create new ones.
Download the new provisioning profiles and install them in Xcode by just dragging
them to the Xcode icon in the dock.
The same action is also mentioned on this post.
Make sure your certificate is in the "login" keychain. Highlight the login keychain if you don't see it, search for it. Then drag the cert over the words "login". Close and re-open Xcode, ta-da.
You need to copy over the private key and certificate from your old Mac. Open Keychain Access on the old Mac and look in the Keys category of the login keychain: the key should be there. You need to export both the public and private key, then copy yourkey.pem and yourkey.p12 to the new Mac.
Importing them using Keychain Access will probably fail, at least under 10.6; you can use these commands instead:
security import yourkey.p12
security import yourkey.pem
For the error
Valid signing identity not found
see Apple's published steps to resolve this problem.
Regarding the issue of your "5 existing provisioning profiles" on the iOS Portal which are missing from your local library in Xcode 4.x Organizer > Devices tab > Provisioning Profile section under Library.
I recommend following the steps that walks you through restoring missing profiles and also covers the case of an Xcode bug in which Xcode 4.1-4.2.1 mistakenly deletes from your local library profiles which are "Active" on the iOS Portal.
You will have to go to your developer site, go to your certificates, and generate a new one for your current MAC and add it to your keychain.
And then you will need to add the Provisioning Profile again. It should work now. Basically you need to perform the same steps you did when you first got your Dev Certificate.
I had the same error but the issue was slightly different.
We have a team of developers but we all use the same Apple ID (Developer Account), so when I generated the Provisioning profile, I kept getting the same error as in the subject question. Then although I had downloaded the certificate (that gets prompted as part of the Development Provisioning Assistant steps), I was still getting that error. Then I found the issue was that our Apple Developer account was using a Certificate that was generated on my work mate machine, so I needed to revoke it, and generate a new certificate, then create the provisioning profile.
The Summary, the lesson learned is that the certificate that is used for your provisioning profile must be generated on the same computer where the provisioning profile will be used. This is especially important to consider when you have a team of developers sharing the same Apple ID.
Hope it helps somebody
My 2 cents on this error, even if not related to an export/import scenario:
when adding the mobile provisioning certificate (i.e. the PROV file), DO NOT drag the file from Finder to Keychain Access. Instead, just double click the PROV file within Finder, while keeping the Keychain Access application running somewhere.
I've actually seen my former provisioning item in Keychain (the one with yellow light) being substituted with a new, green one with same name and app ID. HTH
I faced this problem this morning when I just opened an old app with a different certificate and allowed its access to the keychain. My other app that was working pretty well, stopped working with this error. I've been pulling out my hair till now, when I simply did this:
Xcode Menu > Preferences > Accounts > THE_APPLE_ID_THAT_YOU_ARE_USING > View Details
In the new window, at the bottom left of the Signing identities press the + button and select iOS Development. It'll re-add the identity, and after that my problem is fixed now and the app is running on the device again.
My MAC OS Crashed recently. I reinstalled macOS 10.7.4 and Xcode 4.5. But all provisioning profiles were showing the following message in organizer.
Valid Signing identity not found
I struggled to find help for a couple of days. Later I realized that if you have migrated from one system to another(or formatted your system), you need to export your private key from your keychain from your old system to the new system (or new OS installed).
One can also export your developer profile/team developer profile in organizer.
Organizer > Teams > Developer Profile > Export
Hope it helps.
I had the same thing happen to me as Tiguero (thank you for your answer, it gave me hope), but here is a way to get rid of the "valid signing identity not found" error without having to delete all your provisioning profiles.
If you are on a new system and cannot retrieve your keys from another system, you do indeed have to delete and regenerate new Development and Distribution certificates for Xcode. You can do this via Xcode, or the old-fashioned way using Keychain Access.
Then what you can do is go into Provisioning, and in each tab, Development, and Distribution, click Edit next to the profile you want to update, and then Modify.
You will see a list of certificates, and you must check off the box next to the one you just made, then Submit.
Once you do this, go into your Xcode (I'm using 4.3.3)
Organizer > Devices > Library > Provisioning Profiles where you are getting the error message, and click Refresh. Once you answer the prompt to enter your developer login, Organizer will re-download the profiles, and the error message should go away.
I solved the "Valid signing identity not found" error with more or less:
Make sure that the certificate in your iOS developer program is also listed in your keychain access and is valid (compare the issue dates). If it is not, either transfer it from your old mac using the instructions from apple reference OR delete it from the website and your keychain access and then recreate it, re-download it and drag it over Xcode.
Delete any existing development or distribution provisioning profiles and recreate them based on your new certificate, redownload them and verify from keychain access that everything is valid.
It seems that you can transfer your Certificates and Provisioning profiles from one machine to the other, so if you are having issues in setting up your certificate and/or profiles because you migrated your Dev machine, have a look at this:
how to transfer xcode certificates between macs
The trick for me was discovering that even though I could see the developer cert under login, it was not under My Certificates. The fix was to export the cert from the keychain on the old mac, then import it into My Certificates/login on the new mac.
No one has mentioned this yet, and this may not be a common problem, but I had a similar problem with Xcode 5: Make sure you have a default keychain selected in the Mac's Keychain Access. I trying out a fresh install of Mountain Lion and deleted one keychain, which happened to be the default. After setting another keychain as the default (right-click on the keychain and select Make Keychain "Keychain_name" default"), Xcode was able to set up the valid signing identities.
I had this problem because the iOS Development Certificate associated with the provisioning profile was not in my keychain. I had reinstalled OSX and this was the result. I did the following:
developer.apple.com under Certificates, Identifiers & Profiles
select the corresponding (and valid) iOS Development Certificate, Download it
double click the downloaded file, it gets added to the keychain
errors in organizer go away
If you don't have a valid cert, generate a new one and make a new provisioning profile with it.

A valid provisioning profile for this executable was not found for debug mode

I am getting this error while I am trying to debug my app on device.
I created development provisioning profile as it is mentioned at the developer portal. My development device is selected in the profile and I am selecting the correct profile from Target's code signing identity menu. I recreated provisioning profile for several times and also removed and reinstalled it and recreated the project but I am getting that whenever I try to debug on device.
Btw, the adhoc distribution provision profile works.
I spent my whole day to find out a solution but nothing. Anyone have a solution?
It could be because your iphone is not recognized by the provisioning portal.
Solution:
In Xcode, Goto --> Build --> clean all targets.
In "Groups & Files" -->Target --> expand it --> right click your app and select Clean "your app"
Goto->Window-->Organizer
In the Devices tab on the left, select your iphone
In the Provisioning section of the selected iphone delete all the current profiles (if any)
Unplug your iPhone and replug it in.
Goto->Window-->Organizer-->right click your iPhone -->Add device to provisioning portal
Now make sure you have selected the appropriate code signing identity in edit project settings -> build --> code signing
Build and run.
In Xcode 10, I solved this by switching the project's build system from "new build system" to "legacy build system" (File -> project Settings).
I had the same problem. Everything was ok:
the device was registered in IOS Provisioning Portal; the certificate was downloaded and the Development Provisioning Profiles for my app was downloaded.
So the solution!!!
Target> Get Info
Select Configuration to Release (here's the devil)
In code signing, Code Signing Identity check iPhone Developer. Close.
On Target chose Clean Target and then Run the app.
Good Luck.
In my case this was because there where a couple of versions of the developer certificate in the keychain.
Deleting the iPhone Developer cert from both My Certificates and Certificates and then downloading the latest one from the dev centre and installing that (double click on the .cer file)
sorted my problem
Finally i could solve the problem. One of my colleagues has revoked the developer certificate at iOS Provisioning Portal for his test apps. for fixing; i removed the existing developer certificate at my keychain, requested a new certificate with the existing private key, revoked the certificate from provisioning portal and submitted the newly requested certificate.then i downloaded and installed it.
now i can debug my app on my device :)
This caught me out because someone had changed the "Run" configuration's "Build Configuration" setting to "Release" (under "Product" > "Edit Scheme.." > "Run *.app").
This is normally set to "Debug" and hence it was NOT using the developer certificate and provisioning profile that I was expecting, it was using the distribution certificates instead.
In addition to this I found that if you look in the Console Log for the device (via Organiser), there may be an error code that better indicates your problem. For example I had...
Mon Sep 5 09:39:56 unknown installd[304] <Error>: profile not valid: 0xe8008012
I then googled "0xe8008012" and got the following page which indicates a "0xE8008012 - The UUID of the device does not match any in the Provisioning Profile being loaded" error.
MobileInstallation
Xcode->Click your app -> TARGETS -> click the app-> Build Setting-> Code Signing : Make sure that both Debug and Any iOS SDK are set to iPhone Development
Xcode -> Product -> Scheme -> Edit Scheme: Make sure Build Configuration is set to Debug.
I had the same issue with Xcode 10.0 beta 5 (10L221o) and a device running iOS 12.0 (16A5345f) - that's also beta.
After installing the app alert titled "App installation failed" showed up, "A valid provisioning profile for this executable was not found.".
I got rid of it by going to: ~/Library/MobileDevice/Provisioning Profiles and finding the certificate Xcode was trying to use. Then in the "Devices and Simulators" window in Xcode, I right clicked on my device, choose "Show Provisioning Profiles" and with a plus button added the provisioning profile to the device there.
I don't remember when I've done it last time, it's been years. I guess that Xcode normally does it for us but for some reason, it fails when we see that message.
In my case this problem occurred because another provisioning profile was selected for the unit tests. Just took me hours to find this ...
With Xcode 6 and a new device:
Press cmd + shift + 2 to open devices.
Press the "register device" button. If there is no such button (like in the screenshot) go to developer.apple.com and add it manually. Copy the Identifier into the field.
Go to Xcode -> Preferences -> Accounts -> Doubleclick on your account -> Press the little refresh button on bottom left to refresh the profiles
Go to Code Signing and set the new profiles.
We can try this: This has solved my problem . You need to reset the profile for which your device id has been added into your member area of Apple.com . .
Assuming you have your development and distribution certificate installed correctly:
Under Project your main code signing identity should be the developer profile for that app.
Under Targets your main code signing identity should be the distribution profile for that app, except that you should change Debug > Any iOS SDK to your Development profile... and make sure Release > Any iOS SDK is your Distribution profile. This should build and run on your provisioned phone and should archive without any codesign warnings.
Only thing that worked for me when my phone crashed and I had to restore it from a previous iTunes image.
This solution worked for me
Go to Xcode --> Preferences --> Account.
In the provisioning profiles section, right click and open with finder.
Delete all provisioning profiles from the provisioning profile folder.
Finally, go back to Xcode and click the refresh button.
I hope that helps!
I had the same problem. what I did is:
1. clean the target
2. exit the xcode
3. restart xcode
4. rebuild.
and it worked.
Another cause (verified):
Apple has a major bug in Xcode going back to version 3.x, where it magically overwrites the OS X keychain with a fake keychain from inside Xcode, re-installing certs (and private keys!) that you already deleted
...so, if you have "new cert" installed, and nothing else, Xcode will sometimes get into an infinite loop where it will keep ALSO installing "old cert" (that doesn't exist anywhere except inside XCode!).
...and because of ANOTHER bug in Xcode (unfixed for 3+ years now...), Xcode sometimes automatically selects the "oldest cert I can find" (whcih, by definition, is incorrect - I think someone at Apple got mixed up between "oldest" and "newest" :( )
...and EVEN THOUGH you've selected the correct provisioning profile, Xcode sends the "old" provisioning profile to the device, then signs with the "new" profile, causing this error
Solution: you have to un-FUBAR Xcode's FUBAR of your Keychain.
This is harder than it sounds (there are multiple SO posts on this topic) - it involves multiple reboots of your machine, deleting the key every time.
Eventually, Xcode gives up on corrupting your OS, and accepts the reality you present it with :).
Changing the provisioning profile to automatic then running prompted Xcode to "fix" the issue. I then changed back to my original provisioning profile and everything worked fine.
In my case a valid provisioning file is because I didn't add the device to the very provisioning file.
Had the same problem. My solution was very easy. I checked If I have my device's UDID in developer.apple.com and it was absent. After I added it, it starts working. It is very annoying that Apple developers give error "A valid provisioning profile for this executable was not found" instead of "UDID is not found". Actually I mentioned it first in XCode 6...
In my case, it was the problem when I setup my time manually two month earlier on my iPhone. But when I changed to set time automatically, it worked fine.
Setting -> General -> Date & Time -> set time automatically
If it does not work set time automatically of both mac & iPhone, will work fine.
Remove certificate, profiles and recreate it. Install it. Thats the best soultion.
In my experience this problem happens if you try to build on a device that is not registered in your developer center or is not enabled inside provisioning profile that you are using.
1) Add the device to the developer center.
In XCode 5 you'll still find a button "add to member center" inside the Organizer window.
In XCode 6 i suggest to copy the device ID and manually add it to the device section of your member center.
2) Edit the provisioning profile you're using to include the device you have just added. Save and synchronize provisioning profiles from XCode.
Clean, and it is on.
One of the cause could be your "project => Build Settings => Signing => Development Team" is different from your "target => Build Settings => Signing => Development Team", just make them same
After select auto manager signing
You may still need to check the selection in settings. Sometime, it's not correct there.
I had a certificate that expired (which generated the error).
Step 1. Go to developer.apple.com, login, and go to IOS provisioning portal
Step 2. Go to certificates (which is now empty), and follow the instructions listed to create a new certificate (open keychain on your computer, create a signing request, save it to disk, upload it to apple)
Step 3. Download and install the files created by apple to your keychain
Step 4. Problem: all of your previous provisioning profiles were associated with your OLD certificate, so you need to go back to developer.apple.com->IOS provising portal-> provisioning profiles and 'modify' each profile you care about. You will see that your identity is no longer assicated with the profile, so just click the check box
Step 5. Download all the profiles you changed
Step 6. Plugin your phone and drag and drop the .mobileprovision file onto xcode icon in the dock bar to install them on the device
I saw this problem because I had obtained a new Mac, and was still using my old Computer's certificate. I had created a new certificate for the new Mac, but had both certificates in my keychain.
In the Organizer, the profile warned that "XCode could not find a valid private-key/certificate pair for this profile in your keychain" even though the old certificate existed in my Keychain.
The solution was to delete the old certificate from my Keychain and delete/revoke of all the profiles which used this old certificate. Then create a new profile with the new certificate and use this.
Hope this helps!
Bringing an app up from Xcode 3 to 4.3 I found the Bundle name and Bundle identifier had to be set to match the AppId.
If all else fails, give that a whirl.
I faced same issue there may some other reasons too:
While testing i set my date to some future date and profile got expired. As result this issue was generated.
But i solved by setting date of iphone to current date as a result profile was not expired.
I'm compiling my app in Adobe Air for iOS, not Xcode. I was trying to copy the .ipa using iTunes, and got a mysterious "Error installing app" message. It wasn't until I used the iPhone Configuration Utility (iCU) that I got the real error message.
The problem was that I was compiling the app with a provisioning profile for ad hoc distribution and a certificate for development. I didn't understand that there are 2 types of certificates, and 2 types of provisioning profiles. There's one of each for development and one for distribution. If they don't match... then you get that error message. It's obvious once you understand it...
The solution was to download the distribution certificate (.cer), double click to open in Keychain, and export that as P12 from KC directly. Then use that P12 distribution certificate in the publish settings (Flash IDE or Flash builder), and also use the provisioning profile used for ad hoc distribution (.mobileprovision). Then finally install the provisioning profile and the .ipa file using the iPhone Configuration Utility.
That did it for me.
In my case my provisioning profile was invalid because apple has changed some of its terms and conditions. To fix problem I had to
delete previous profile.
I had to accept terms and condition from this website of apple.
Click Your app from Xcode Under Targets. (Under project.) Here you see Summary info, build settings, Build phases, build rules.
Okay go to Build Settings. Go down to Code Signing.
You see you have two fields Debug and Release. You have two profiles to choose from in each of those fields, Distributing and developing.
Let distributing be the one from the Release field. Let Developing be the one from the Debug field.
Doing this solved this problem, and let that error message go away. Now I can run my application fine.

Code sign error with Xcode 3.2

I had a fully working build environment before upgrading to iPhone OS 3.1 and Xcode 3.2. Now when I try to do a build, I get the following:
Code Sign error: Provisioning profile 'FooApp test' specifies the Application Identifier 'no.fooapp.iphoneapp' which doesn't match the current setting 'TGECMYZ3VK.no.fooapp.iphoneapp'
The problem is that Xcode somehow manages to think that the "FooApp Test" provisioning profile specifies the Application Identifier "no.fooapp.iphoneapp", but this is not the case.
In the Organizer (and in the iPhone developer portal website) the app identifier is correctly seen as 'TGECMYZ3VK.no.fooapp.iphoneapp'.
Also, when setting the provisioning profile in the build options at the project level, Xcode correctly identifies the app identifier, but when I go to the target, I'm unable to select any valid provisioning profile.
What could be causing this problem?
Update: I've tried to create a new provisioning profile, but still no luck. I also tried simply changing the app identified in Info.plist to just "no.fooapp.iphoneapp". The build succeeds, but now I get an error from the Organizer:
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).
This seems reasonable, as the provisioning profile still has the "TGECMYZ3VK.no.fooapp.iphoneapp" application identifier.
I also double checked that all certiicates are valid in the Keychain.
So my question is how I can get Xcode to see the correct application identifier?
UPDATE: As noted below, what seems to fix the problem is deleting all provisioning profiles, certificates, etc., making new certificates / profiles and installing them again. If anyone has any other solutions, they would be welcome. :)
I had to manually remove the provisioning profiles from my phone, then rebuild the apps after doing a "clean all targets" from the build menu.
That's under Settings -> General -> Profiles
This happened to me when I got a new Mac. You'll fix it, don't worry
Well, as seems to be the case with a lot of these code signing issues, deleting all provisioning profiles, certificates, etc. and revoking and generating everything all over again turned out to do the trick. I even created a new bundle identifier, app identifier, etc., and now AdHoc distribution is working again.
I had this same error yesterday. I tried all of the various resetting procedures in the other answers with no luck. Eventually I also
rebooted my mac
rebooted my iPhone
deleted all of my iphone provisioning profiles from the phone using XCode
deleted all profiles from my mac (~/Library/MobileDevice/Provisioning Profiles for me)
what else? deleted build folder, restarted XCode, installed update to 3.1.2 sdk, sacrificed a chicken.
Lo and behold, it now works, the error is gone. This is serious voodoo territory.
Also, make sure that you added a reference to the Entitlement filename "dist.plist" in your project configuration CODE_SIGN_ENTITLEMENTS.
Check both Code Signing Entitlements in info for both the Build Target and the Main Application - if Code Signing Entitlements says on either then remove it
In XCode, in the "Groups & Files" pane, expand "Targets" and double-click on your app's target.
This will bring up the Info pane for your target. In the "Build" section, check the "code signing" section for any old profiles. This has happened to me many times particularly after an upgrade to a new version of the sdk and iphone os
Quick Hack if you are on Xcode 4.3.
In Xcode under Project Settings > MyTarget > Summary tab all the way in the bottom there is a checkbox that says "Enable entitlements". When I unchecked it, it made the error go away.
Inside Resources/Entitlements.plist there is a Boolean "get-task-allow" if that is not checked, check it ON. This fixed the issue for me.
After being stumped by this for quite a while I revisited the settings and discovered that I had reversed the 'Code Signing Identity' and the 'Any iPhone OS Device' entries. - The clue I had as to this happening was shown by.
Deleting every profile off the phone
Build and Go
At this point xcode attempts to provision the phone (device)
Examine the phone to see which provisioning profile has been added.
As I prefix all my profiles 'AdHoc' or 'Development' or 'AppStore' I saw immediately that the install process was putting a development profile on the device and not an AdHoc profile.
The device may not be in the list. Try modify your provisioning profile.
Just to add a note here: I encountered the same error (0xE8008016) after replacing my Macbook's logic board (although I imagine you'd have the same problem on a completely new mac), and after hours of going around in circles I realised that the iPhone Developer Program Portal had separate certificates for Development and Distribution.
A change in hardware means you need to reissue both certificates - I'd reissued Developer but not Distribution. Because my name hadn't changed when my hardware did (and certificates are identified by the owner's name), this made it a tricky problem to spot ;) Hope this saves someone else my frustration.
For reference, I ran into the same issue and deleting all of my profiles, existing certs and everything from my local drive and from the developer portal, and deleting my existing devices and re-adding them (developer portal) seemed to do the trick.
The problem is in the "project.pbxproj" file located inside the [your project].xcodeproject file. If you feel brave right click on the .xcodeproject and view contents then open "project.pbxproj" with a plan text editor. Inside search for the offensive path and correct it. In my case I just removed the entire path and just left "Entitlements.plist" and it cleard my issues up. I STRONGLY reccomend backing up your .xcodeproject before attempting this.
Double click the target then select the "Properties" tab. There change the com.yourcompany.${...}.
Another cause is if the device you want to install onto is not an approved device in the Distribution Certificate.
Sometimes Xcode does not automatically copy your provisioning profile to the right location.
In my case, that was true.
Check that your provisioning profile is in ~/Library/MobileDevice/Provisioning Profiles directory and if not just drag and drop, clean and build

The executable was signed with invalid entitlements

I am having a problem with ad-hoc distribution on my iPhone. I have developed an application with SDK 3.0. I have a developer's license. I have added certificates and provisioning profiles in my project. So, no problem with that.
But, when I try to install the app on my iPhone, it compiles the project and then displays the error: "The executable was signed with invalid entitlements" in the Organizer window. Am I missing something? I have upgraded my iPhone from 2.2.1 and have downloaded latest SDK from Apple.
Please help me with this issue.
There are pretty good instructions in the 'Portal Program'. If you log into
http://developer.apple.com/iphone
Then click Distribution on the left, and click the
Creating and Downloading a Distribution Provisioning Profile for Ad Hoc Distribution
link at the bottom.
Here's the key bit:
For Ad Hoc Distribution, complete the following:
In the File Menu, select New File -> iPhone OS -> Code Signing -> Entitlements.
Name the file “Entitlements.plist" and click ‘Finish’. This creates a copy of the default entitlements file within the project.
Select the new Entitlments.plist file and uncheck the “get-task-allow” property. Save the Entitlements.plist file. (in Xcode 4, get-task-allow is called "Can be debugged" )
Select the Target and open the Build settings inspector. In the ‘Code Signing Entitlements’ build setting, type in the filename of the new Entitlements.plist file including the extension. There is no need to specify a path unless you have put the Entitlements.plist file somewhere other than the top level of the project.
Click ‘Build’. (Note: Your binary must contain a flattened, square-image icon that is 57x57 pixels. This icon is displayed on the iPhone or iPod touch home screen.)
This error also may occur if you're trying to profile an app where the device is not included in the provisioning profile.
Make sure your device is included in the dev provisioning profile you want to use. Somehow the error message is misleading. My entitlements were actually ok.
I have found that "get-task-allow" needs to be checked for Development builds but unchecked for Distribution builds. The easiest way to accomplish this (AFAIK) is to have two entitlements files in your project: Entitlements.plist and EntitlementsDebug.plist - and to reference the proper one in the build project settings for the various configurations in your project.
Code signing entitlements are no longer necessary for Ad Hoc builds in Xcode 4 - see details notes in Apple Technical Note TN2250
If you once come into the situation, that checking "get-task-allow" seems to be required in order to deploy your debug (!) build to your phone, check this:
a) Check the build setting. There should be no entry in "Code Signing Entitlements" for Debug
b) Remove Entitlements.plist temporarily and build your debug version. If it complains about a missing Entitlements.plist, then you probably have the same situation, I had to fight today.
c) Build again with Entitlements.plist and enable "get-task-allow". If it works now, you probably have the same problem:
After messing around with new profiles I couldn't deploy my Debug build to the phone. AdHoc was fine. I checked a) - empty.. Hmm. I checked b) - complains. c) - worked...
After all I examined project.pbjproj in an editor and - although the GUI did claim, that there was no entry for "Code Signing Entitlements" in fact there was one in the Debug section. I emptied it and was done.
This is because your device, on which you are running your application is not selected with your provisioning profile.
So just go through Certificates, Identifiers & Profiles select your iOS Provisioning Profiles click on edit then select your Device
I have just had an exciting three hours battling with this. I have just upgraded a project to 4.2 and for some reason it just wouldn't work.
I eventually removed the Entitlements.plist file and then created a new one.
File > New File > Code Signing > Entitlement
Name the file Entitlements.plist
Make sure it's in the Resources group in xCode.
It didn't put in the get-task-allow BOOL type in the Entitlements.plist file. I added it, checked it, saved it, unchecked it, saved it. This made me feel better.
I then removed the Adhoc and Release profiles I had created. Re-downloaded them from the Provisioning Portal and droped them back into the xCode organizer.
I then went into Build Settings and made sure the correct profiles were assigned to the Debug and Release profiles.
I then changed the to Release / Device. Hit the build button and it worked.
I have no idea why.
John's answer is 99% correct. I found that (at least in my configuration), you have to open the Build settings inspector for the PROJECT. The build settings for the target do not contain "Code Signing Entitlements". Perhaps this doesn't make a difference if you have only one target in your project. But if you have multiple targets, you need to go to the project build settings. In any case, after doing what John said, my ad-hoc distribution build worked perfectly.
In Xcode 5.1, if you go into Preferences -> Accounts -> View Details...
Make sure the Signing Identity status is Valid. If it says Revoked, hit the Plus button and add the appropriate signing identity: iOS Development or iOS Distribution. Xcode will replace it with a new, valid one.
For me that solved it:
https://coderwall.com/p/-ckobg
Open Project.xcodeproj > project.pbxproj
Remove all lines like these:
PROVISIONING_PROFILE = ...
"PROVISIONING_PROFILE[sdk=iphoneos*]" = ...
CODE_SIGN_IDENTITY = ...
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ...
Set provisioning profiles & code signings for the target again
pJosh, this might help understanding. In my case, my Team Provisioning Profile was expiring (the Provisioning Portal indicated it is managed by XCode), as well as the device testing profile for the app. (I still don't know why, but the portal had a "Renew" button next to the team profile, but it wouldn't do anything when I clicked it.)
So, I deleted the profiles about to expire, then in XCode go to Organizer (Command-Shift-2), under Library / Provisioning Profiles, I deleted the expiring ones. Then click "Refresh" at the bottom, enter my Apple ID, and it renewed the expiring ones.
Finally, on my Target, I went to Build Settings, Code Signing, and made sure to select the provisioning profile. Voila, now it builds to my device.
Just got this same error code.
It seems there are different things that cause this and therefore different ways to fix it.
In my case, I had two different devices with the same name (an iPhone 4 and an iPhone 4S). Changing the name of one of them fixed this error completely for me...
I was trying to add iCloud support to my existing app, but found that after adding entitlements and configuring iCloud, my app would no longer debug.
I realised that my generic iOS development certificate had a different APPID from the app I was working on. So to fix it, instead of using my generic certificate I created a specific development certificate for that APPID.
I refreshed my provisioning profile in XCode, cleaned out the app, disconnected my device, restarted XCOde and connected device and ran, and it now works a treat!
I also spent several hours fighting with this as well. The fix is real simple. Edit your Entitlements.plist file in the root of your project's directory. Find the line that says <key>get-task-allow</key>. Underneath it should be <false/>. Change that to <true/>.
Sorry that this is very late, but I just was looking at this question and found something that worked for me. I went to PROJECT->Build Settings and found the Code Signing section. Beside debug, my distribution profile that said Iphone Distribution: MY NAME was selected. I instead selected Iphone Developer: MY NAME on the drop-down list under IpodProfile (for bundle identifiers com.myName.myApp which was the provisioning Profile for my device. Hope this helps!
I just had this happen to a developer on the team I administer.
It turned out his developer certificate expired and after renewal, I neglected to add his certificate to the provisioning profile his app used.
I had not agreed to the new updated licensed agreement from apple.
Briefly : Please log in to your developer's account -> profile's -> review -> read the agreement or get your lawyer read it for you -> agree (at your own will) -> and again click profile's to check the status of your profile.
In my scenario the valid code signing entity was not showing up. When i followed the above procedure it was visible and i was able to run the app on the device and/or create the iPA file without much difficulty.
Had this issue occur when everything seemed to be setup correctly, build setting were pointing to correct provisioning profile, code signing was properly setup, etc.
Issue occurred because I had just created a new scheme and hadn't regenerated my CocoaPods for the new configurations. As you can see from the image, the new ad-hoc configuration is pointing to the Pods.production configuration, instead of a Pods.ad-hoc configuration (and test respectively)
To fix:
Set the offending configuration to None -- cocoapods wouldn't generate the configs unless I did this
Close XCode
Run pod install
Re-open XCode and set the new scheme's configurations to the newly generated configurations.
That's it!
Check if you're device is included in the provisioning profile.