I have been getting this error myself and found this helpful post:
but since I am using xcode 4 I wanted to add the guidelines for doing the same on xcode 4 so here goes:
1. on the project navigator (left most gray icon that looks like a folder) click your app
2. on the main pane that opens click "build Settings" at the top
3. scroll down the main pane until you reach "Code Signing Identity" and go on and
select the right code signing identity.
Eyal