views:

2754

answers:

2

Tried to rebuild an app that was just working yesterday. Got a message that a profile had expired, so I removed it from the iPod and from Itunes. When I chose a new profile (one with an * in the identifier), I now get an error:

Code Sign Error: Provisioning Profile (long string) can't be found.

What am I missing? I looked through related questions and didn't see this scenario already. Thanks

+17  A: 

Sometimes your xcode project file gets messed up, especially if you have an old project and first created it with an older version of xcode/iphone sdk. What you need to do is open up the project file in a text editor, search from the long sting and manually erase that line. In fact, you should just go aead and erase any line that points to any provisioning profiles. Then reopen the project in xcode, go to the settings are reselect your new profile. This clears up issues like that most of the time The lines that point to the provisioning profiles will look like this:

PROVISIONING_PROFILE = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";
Brad Smith
Thanks for the reply. I got an error "The document could not be opened" trying to open the .xcodeproj file with TextEdit (just restarded and Xcode is not running). Any idea?
quantumpotato
The .xcodeproj file is actually a directory, like an application bundle, If you right click it in finder, you can select show package contents, and then you will see several files inside (or in terminal just cd into it). The actual project file is the one in there with a .pbxproj extension. Once you open it with a text editor the lines you are looking for should start with 'PROVISIONING_PROFILE = or' '"PROVISIONING_PROFILE[sdk=iphoneos*]" ='. Delete all of those and then you should be good.
Brad Smith
That worked! Thanks very much, appreciate the help.
quantumpotato
Thanks so much! Who knew XCode was so convoluted...
pop850
Fixed it for me, too... I just even more respect and faith for Xcode today.
Nik Reiman
+5  A: 

Here's a simpler solution that worked for me and which doesn't require the manual editing of the project file:

In XCode, in the "Groups & Files" pane, expand "Targets" and double-click on your app's target. This brings up the Info pane for the target. In the "Build" section, check the "code signing" section for any old profiles and replace with the correct one.

Note that this is different from double-clicking on your project icon and changing the profile from there. Quite amazing :)

Ori

Ori
Thanks! I'll try this next time it happens :)
quantumpotato
thanks Ori..that fix my problem
Nnp