{"id":639,"date":"2009-08-11T16:06:21","date_gmt":"2009-08-11T15:06:21","guid":{"rendered":"http:\/\/t-machine.org\/?p=639"},"modified":"2009-08-11T16:06:21","modified_gmt":"2009-08-11T15:06:21","slug":"uploading-iphone-app-to-app-store-fails-with-codesign-validation-error","status":"publish","type":"post","link":"http:\/\/new.t-machine.org\/index.php\/2009\/08\/11\/uploading-iphone-app-to-app-store-fails-with-codesign-validation-error\/","title":{"rendered":"Uploading iPhone app to App Store fails with CodeSign validation error"},"content":{"rendered":"<p>I&#8217;ll be writing this up in more detail soon, but here&#8217;s a bad error message from Apple&#8217;s App Store process (summer 2009) that I found zero hits for on a google search, so I thought I&#8217;d quickly throw up this page now that I&#8217;ve found out what the cause is. Hopefully it will help anyone else who hits the same problem.<\/p>\n<p>If you&#8217;re using the new Apple Uploader to send your binary to the App Store (don&#8217;t! I&#8217;ve discovered it has at least one critical bug where it claims to upload the binary but it actually hasn&#8217;t!), you might hit this error before the upload starts:<\/p>\n<blockquote><p>\n &#8220;Application failed codesign verification.  Please see the console log for additional details&#8221;\n<\/p><\/blockquote>\n<p>Assuming you know enough about OS X to know how\/where to view the Console, at the end of the log you may see something like this pair of entries:<\/p>\n<blockquote><p>\nApplicationLoader[18609] *** Codesign error (please ignore invalid option comments): got requirements(0x805a00, 525)<br \/>\nExecutable=\/var\/folders\/0o\/0oFmipSKGvqwVZcVZJPOgU+++TI\/-Tmp-\/starcatcher.app.zip\/starcatcher.app\/Star Catcher<br \/>\nIdentifier=no<br \/>\nFormat=bundle with Mach-O thin (armv6)<br \/>\nCodeDirectory v=20001 size=1587 flags=0x0(none) hashes=72+5 location=embedded<br \/>\nSignature size=4274<br \/>\nAuthority=iPhone Distribution: Adam Martin<br \/>\nAuthority=Apple Worldwide Developer Relations Certification Authority<br \/>\nAuthority=Apple Root CA<br \/>\nSigned Time=10 Aug 2009 16:55:51<br \/>\nInfo.plist entries=18<br \/>\nSealed Resources rules=3 files=24<br \/>\nInternal requirements count=0 size=12<\/p>\n<p>Executable=\/var\/folders\/0o\/0oFmipSKGvqwVZcVZJPOgU+++TI\/-Tmp-\/starcatcher.app.zip\/starcatcher.app\/Star Catcher<br \/>\ngot entitlements(0x805e00, 299)<br \/>\ncodesign_wrapper-0.7.3: using Apple CA for profile evaluation<br \/>\nAssertMacros: binary,  file: \/data\/conrad\/security\/codesign_wrapper\/codesign.c, line: 205<br \/>\nAssertMacros: code_signatures,  file: \/data\/conrad\/security\/codesign_wrapper\/codesign_wrapper.c, line: 903\n<\/p><\/blockquote>\n<blockquote><p>\nApplicationLoader[18609] *** Error: \/Users\/adam\/Desktop\/starcatcher.app.zip: validation failures: (<br \/>\n    &#8220;Application failed codesign verification.  Please see the console log for additional details&#8221;<br \/>\n)\n<\/p><\/blockquote>\n<p>What&#8217;s the error message?<\/p>\n<p>Ah, well, despite the second entry claiming that the console log will have an error &#8230; the error itself is missing (like so much of Apple&#8217;s documentation ;)). With a bit of imagination and &#8220;creative interpretation&#8221;, I spotted that:<\/p>\n<p>Line 1:<\/p>\n<blockquote><p>ApplicationLoader[18609] *** Codesign error (please ignore invalid option comments): got requirements(0x805a00, 525)\n<\/p><\/blockquote>\n<p>Line 16:<\/p>\n<blockquote><p>\ngot entitlements(0x805e00, 299)\n<\/p><\/blockquote>\n<p>and inferred that there was a problem with a checksum, whereby it was expecting something that looked like X, but found something that looked like Y.<\/p>\n<p>(NB: Apple&#8217;s appallingly bad lack-of-error-message may mean something completely different, but this guess lead to me trying something that ended up fixing the problem)<\/p>\n<p>Looking carefully at my App, looking for signed things not being what were expected, I realised that my app was importing a static library that had been signed by someone else (partly because the new version of Xcode defaults to signing everything, all the time &#8211; which it should do, but I hadn&#8217;t got used to that new &#8220;feature&#8221; yet). With bad code-signing implementations, that can often be a problem (although I naively expected Apple to have a sensible implementation of code-signing, and it had never occurred to me this would be a problem with Xcode. Oops).<\/p>\n<p>Speaking to the person who built that library, I found that the build config they&#8217;d used had been set to sign using a Developer provisioning profile. I re-built it using my Distribution provisioning profile, re-added the static lib binary it to my project, re-built my app &#8230; and the App Store upload finally succeeded.<\/p>\n<p>Anyway &#8230; followup post coming soon on how to make static libraries work on iPhone with iPhone OS 3.0 \/ Xcode 3.1.3 and above (hint: Apple broke some of the things that used to work, and so sometimes you have to do it differently since OS 3.0 came along)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ll be writing this up in more detail soon, but here&#8217;s a bad error message from Apple&#8217;s App Store process (summer 2009) that I found zero hits for on a google search, so I thought I&#8217;d quickly throw up this page now that I&#8217;ve found out what the cause is. Hopefully it will help anyone [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[],"_links":{"self":[{"href":"http:\/\/new.t-machine.org\/index.php\/wp-json\/wp\/v2\/posts\/639"}],"collection":[{"href":"http:\/\/new.t-machine.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/new.t-machine.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/new.t-machine.org\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/new.t-machine.org\/index.php\/wp-json\/wp\/v2\/comments?post=639"}],"version-history":[{"count":0,"href":"http:\/\/new.t-machine.org\/index.php\/wp-json\/wp\/v2\/posts\/639\/revisions"}],"wp:attachment":[{"href":"http:\/\/new.t-machine.org\/index.php\/wp-json\/wp\/v2\/media?parent=639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/new.t-machine.org\/index.php\/wp-json\/wp\/v2\/categories?post=639"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/new.t-machine.org\/index.php\/wp-json\/wp\/v2\/tags?post=639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}