Xcode codesigning fails every other build
My iPhone project fails to build every other time and gives me the following info:
CodeSign build/Debug-iphoneos/coati.app
cd /Users/rpeck/Documents/Coati
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv _CODESIGN_ALLOCATE_ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
/usr/bin/codesign -f -s "iPhone Developer: Ryan Peck (6VVQ开发者_C百科HFN5NU)" --resource-rules=/Users/rpeck/Documents/Coati/build/Debug-iphoneos/coati.app/ResourceRules.plist --entitlements /Users/rpeck/Documents/Coati/build/Coati.build/Debug-iphoneos/Coati.build/coati.xcent /Users/rpeck/Documents/Coati/build/Debug-iphoneos/coati.app
/Users/rpeck/Documents/Coati/build/Debug-iphoneos/coati.app: object file format invalid or unsuitable
Command /usr/bin/codesign failed with exit code 1
The first time I build it always fails. The second time succeeds, even if I've made changes to the files between the builds. If I clean the target, the next build will always fail.
This is all in debug mode. In release mode the builds fail the same, but the successful builds always say "Failed to load" when installing onto the phone. I checked that the provisioning profile matches and is selected.
I've found one similar question where the answer turned out to be multiple Info.plist files in the project. I've looked mine over completely and there is no extra Info.plist file. I've also removed and reinstalled my provisioning profiles.
The other answers I've seen for this error involved defining the path for the ResourceRules.plist file. I've tried the solutions presented in those cases with no success.
Right now it's more of an inconvenience than anything since the second time I build it works fine. I'm more worried that down the line when I'm ready for a distribution build it will give me problems, especially since the release build configuration won't install to the phone.
All of this started after a problem with a mercurial commit when I did not pay attention to the fact that xCode was open. It corrupted my project file, and while all the source was fine, when I created a new project and then brought in all of my old source files this problem cropped up.
Ok, I gave starting over from scratch with a new project a try again. This time I added back my source in chunks trying to isolate any issues. Some of the files created by the project template had to be modified by hand instead of just replaced. It seems to be working fine now though.
精彩评论