Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 958
Joel Avatar asked Mar 13 '12 09:03

Joel


4 Answers

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.

like image 104
GilroyKilroy Avatar answered Oct 31 '22 16:10

GilroyKilroy


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.

like image 35
Joel Avatar answered Oct 31 '22 17:10

Joel


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.

like image 5
Vikings Avatar answered Oct 31 '22 17:10

Vikings


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.

like image 2
mochasoft Avatar answered Oct 31 '22 17:10

mochasoft