Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Codesign object file format invalid or unsuitable

I accidentally deleted my target in xcode.

so i created a new one with the exact same name. in the target settings i again selected the proper codesigning identity

but now i can't compile for the device anymore. as soon as i want to build, i get:

CodeSign build/Release-iphoneos/myApp.app
....somestuff....
/Volumes/XCodeProj/myApp/build/Release-iphoneos/myApp.app: object file format invalid or unsuitable
Connad /usr/bin/codesign failed with exit code 1

I already tried to clean targets. what could cause this problem and how to solve it?

like image 359
Mat Avatar asked Jan 30 '11 11:01

Mat


4 Answers

May also be an issue with your install. Symlinking to the latest codesign_allocate cleared up the issue in my case:

sudo mv /usr/bin/codesign_allocate /usr/bin/codesign_allocate_old
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin
like image 166
Ed McManus Avatar answered Oct 04 '22 00:10

Ed McManus


In Mountain Lion, you can try to run this before codesign:

export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
like image 27
Marius Avatar answered Oct 04 '22 00:10

Marius


Make sure the 'Executable Name' (CFBundleExecutable) entry in your target's info.plist matches the 'Product Name' specified in your target settings.

like image 26
Julio Gorgé Avatar answered Oct 04 '22 00:10

Julio Gorgé


I had this issue when I was trying to codesign from the terminal. I had just installed Xcode 4.4 after uninstalling Xcode 3.0. Took a look at the Downloads in Xcode preferences and noticed that the Command Line Tools had not been installed. My issue was fixed after I installed this. I'm guessing the problem is more complex given the solutions here, but this might be something that future users want to check before they have to start diving deeper.

like image 38
Jeff Blenman Avatar answered Oct 04 '22 00:10

Jeff Blenman