iOS – Codesign Error: Provisioning Profile Cannot Be Found After Deleting Expired Profile

codesigniosprovisioning-profilexcode

Tried to rebuild an app that was working just 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.

Best Answer

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 for the 'long string' from your error and manually erase that line.

In fact, you should just go ahead and erase any line that points to any provisioning profiles. Then reopen the project in Xcode, go to the settings and 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";
Related Question