Thursday, July 2, 2009

Codesign Error and FBConnect Library for Iphone

Just spent the morning tracking down an issue where I couldn't submit an application to the app store. Hopefully good will pick this up and save you some trouble

This is the key issue:
a sealed resource is missing or invalid
You will see that error when using ApplicationLoader while looking at
Here is the full message:

7/2/09 1:26:31 PM ApplicationLoader[1037] *** Codesign error (please ignore invalid option comments): got requirements(0x805a00, 556)
Format=bundle with Mach-O thin (armv6)
CodeDirectory v=20001 size=10131 flags=0x0(none) hashes=498+5 location=embedded
Signature size=4331
Authority=iPhone Distribution: Your Company Inc.
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=Jul 2, 2009 1:25:44 PM
Info.plist entries=20
Sealed Resources rules=3 files=86
Internal requirements count=0 size=12

got entitlements(0x805e00, 323)
codesign_wrapper-0.7.3: using Apple CA for profile evaluation
codesign_wrapper-0.7.3: Caling codesign with the following args:
codesign_wrapper-0.7.3: /usr/bin/codesign
codesign_wrapper-0.7.3: --verify
codesign_wrapper-0.7.3: -vvvv
codesign_wrapper-0.7.3: -R=anchor apple generic and certificate 1[field.1.2.840.113635.] exists and certificate leaf[field.1.2.840.113635.] exists
codesign_wrapper-0.7.3: --entitlements
codesign_wrapper-0.7.3: /var/tmp/signingbox/codesign_wrapper_entitlements.plist
codesign_wrapper-0.7.3: /var/folders/fC/fCYkmIs5EtextlqOt9Oo9E+++TQ/-Tmp-/
/var/folders/fC/fCYkmIs5EtextlqOt9Oo9E+++TQ/-Tmp-/ a sealed resource is missing or invalid
codesign_wrapper-0.7.3: failed to execute codesign(1)

I finally found out that the issue was some strangely named files in the FBConnect.bundle .

The solution is to remove files that start with "._".

Here is the blog post that finally saved me from my mental breakdown.

A solution to: Application failed codesign verification

Thanks Ev.


john said...

Thanks for taking time to share your findings. Thanks for ending a multi-day frustration for me. I'm sure this will be crucial to other developers who are releasing apps with facebook connect functionality.

Laurent said...

Thank you !
I have to admit, all this was pretty stressful, but your post saved the day !

Adam R. B. Jack said...

I had a similar problem where I had same symptoms but no ._ file. I ended up doing an SVN checkout to a new directory, removing all the .svn subdirectories (find . -name \.svn -exec rm -rf {} \; -print) and doing a clean build.

Not only did Find's "Compress File" work (it was failing before) but also uploading to the store stopped complaining.

I'd even rebooted and cleared XCode caches w/ no luck, but this helped. I am not sure if it was the fresh checkout (my gut says yes) or removing the .svn but it helped.

Thanks for the pointer Dave...