Application failed codesign verification, WTF

Dear Lazyweb, I'm having two problems:

  1. This first problem is minor, but makes me wonder if it's indicative of something causing the second problem. When I build my app in "Debug" mode, using "Code Signing Identity: iPhone Developer", and I do "Build and Debug", the app is installed onto my iPhone, but gdb can't connect to it:

      Loading program into debugger...
      sharedlibrary apply-load-rules all
      Program loaded.
      target remote-mobile /tmp/.XcodeGDBRemote-3210-27
      Switching to remote-macosx protocol
      mem 0x1000 0x3fffffff cache
      mem 0x40000000 0xffffffff none
      mem 0x00000000 0x0fff none
      Ignoring packet error, continuing...
      Unknown packet reply: "timeout" to environment packet.
      Unknown packet reply: "timeout" to environment packet.
      The program being debugged is not being run.
      The program being debugged is not being run.

    However, the app is installed on my phone, and when I launch it manually, it runs fine. This suggests to me that the phone is in "developer mode" and has the proper provisioning profiles installed. So why can't gdb talk to it? I've rebooted both the Mac and the phone, restarted Xcode, all the usual things that the first several dozen google hits suggest. Nothing has helped.

  2. The bigger problem is that I can't seem to make a binary that is uploadable to the store. I constantly get "Application failed codesign verification". The googles suggest that this is a very common problem, but none of the suggestions I've found have done squat. (Deleted and re-installed my certs and both my development and distribution provisioning profiles, rebooted everything, etc.) Here's how the last part of the build log goes:

      /usr/bin/codesign -f -s "iPhone Distribution: Jamie Zawinski" --resource-rules=/Users/jwz/src/xdaliclock/OSX/build/Release-iphoneos/ --entitlements /Users/jwz/src/xdaliclock/OSX/build/ /Users/jwz/src/xdaliclock/OSX/build/Release-iphoneos/

      /Users/jwz/src/xdaliclock/OSX/build/Release-iphoneos/ replacing existing signature
      Validate build/Release-iphoneos/
      setenv PRODUCT_TYPE
      /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation /Users/jwz/src/xdaliclock/OSX/build/Release-iphoneos/

      warning: Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)

    So, as you see, it is signing the app (correctly using my Distribution cert, not my Development cert) and then it immediately claims that it is signed incorrectly. But, codesign says that the signature is valid, using my cert and Apple's CA:

      codesign -dvvvv build/Release-iphoneos/

      Format=bundle with Mach-O universal (armv6 armv7)
      CodeDirectory v=20100 size=2087 flags=0x0(none) hashes=96+5 location=embedded
      Signature size=4277
      Authority=iPhone Distribution: Jamie Zawinski
      Authority=Apple Worldwide Developer Relations Certification Authority
      Authority=Apple Root CA
      Signed Time=Apr 22, 2010 11:14:02 PM
      Info.plist entries=27
      Sealed Resources rules=3 files=8
      Internal requirements count=1 size=144

    The "Application Loader" application gives the same error message and no additional clues.

    Any ideas?

    Xcode 3.2.3 on 10.6.3, but I was also having these problems with Xcode 3.2.2. My phone is running 4.0 beta now, but was also failing with 3.1.3.

Tags: , , , , ,

The Raven

Tags: , , ,