I recently created a new provisioning profile and added that to Xcode. The build compiles and runs perfectly but while archiving Xcode is getting code sign error. This is the output at console. I couldn't figure out much from it.
CodeSign /Users/tarunkhurana/Library/Developer/Xcode/DerivedData/App-aqjeimytlifknpbxauygrrollgfw/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App
cd /Users/tarunkhurana/Desktop/App
setenv CODESIGN_ALLOCATE /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/usr/bin/codesign --force --sign "iPhone Developer: XXXXX" --resource-rules=/Users/tarunkhurana/Library/Developer/Xcode/DerivedData/App-aqjeimytlifknpbxauygrrollgfw/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App/ResourceRules.plist --entitlements /Users/tarunkhurana/Library/Developer/Xcode/DerivedData/App-aqjeimytlifknpbxauygrrollgfw/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/App.xcent /Users/tarunkhurana/Library/Developer/Xcode/DerivedData/App-aqjeimytlifknpbxauygrrollgfw/ArchiveIntermediates/App_Parse/InstallationBuildProductsLocation/Applications/App.app
/Users/tarunkhurana/Library/Developer/Xcode/DerivedData/App-aqjeimytlifknpbxauygrrollgfw/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app: object file format invalid or unsuitable
Command /usr/bin/codesign failed with exit code 1
I am using Xocde4.2 and iOS-5. Any help will be greatly appreaciated