Update:
The Technical Note in my original answer is now deprecated. Apple posted a collection of code signing problems (and some solutions) in a new document: Technical Note TN2407 Code Signing Troubleshooting Index
Check the CODE_SIGN_IDENTITY property in your build settings. Is your provisioning profile selected there?
You also need to enter a valid bundle identifier in your apps .plist.
The identifier has to match the one you provided when generating the profile.
Apple has a technote about that here.
I had the exact same error, and tried everything under the sun, including what was suggested elsewhere on this page. What the problem was for me was that in Keychain Access, the actual Apple WWDR certificate was marked as "Always Trust". It needed to be "System Defaults". That goes for your Development and Distribution certificates, too. If any of them are incorrectly set to "Always Trust", that can apparently cause this problem.
So, in Keychain Access, click on the Apple Worldwide Developer Relations Certificate Authority certificate, select Get Info. Then, expand the Trust settings, and for the combo box for "When using this certificate:", choose "System Defaults".
Sigh: for those insistent on downvoting this answer, I am not claiming this to be the only solution for this problem. It's one solution. It may not work for you. There are multiple reasons for this codesign
failure.
Best Answer
I have seen this error when I manually built and signed an iOS application bundle using a Makefile. In that case my
Info.plist
was missing theCFBundleResourceSpecification
key (should probably have the valueResourceRules.plist
). I did some more testing now and it also happens if the keyCFBundleExecutable
is missing.CFBundleResourceSpecification
should be added in some build phase by Xcode but maybe it's a good idea to check the resultingInfo.plist
in the build directory if it's really there.Maybe this blog post could help, it's about
codesign
finding the wrongInfo.plist
file (one withoutCFBundleResourceSpecification
)http://infinite-sushi.com/2010/08/the-case-of-the-missing-cfbundleresourcespecification/