“CodeSign error: a valid provisioning profile is required for product
type ‘Application’ in SDK ‘Device – iPhone OS 2.2.1″
I hate that build error because I have seen it so many times in the last week or two. I think every now and then I access my iPhone projects using the pre-release XCode/iPhone SDK which causes the xcode project corruption. For reference, I have the iPhone OS 3.0 and pre-released XCode in seperate directorys.
I found a few ways to manually edit the project file, but I knew there was a better way. Basically the provision files and the xcode project files don’t get a long. So here is what I did..
- Quite XCode
- Remove [don't delete] the available provisisions from this path: $HOME/Library/MobileDevice/ProvisioningProfiles
- Open XCode
- Quit XCode
- Add those provisions you removed in step 2, back to this path: $HOME/Library/MobileDevice/ProvisioningProfiles
- Open XCode
- Now open the Target Build settings and reset the provisioning profile settings that are listed. For instance, select the DEBUG configuration and select the correct Provision listed. In my case it was: iPhone Developer: Andy Peters.
I should also note that the version of XCode I am opening and closing is the current XCode for iPhone OS 2.2.1 (XCode verison 3.1.2).
Related posts:

Thanks for this tutorial. It’s interesting but I cannot find the MobileDevice folder in my HD. Is it possible that this is hidden folder? If it is hidden, can I unhide it? How? Please help…
Thanks in advance