Question: I'm trying to submit a Mac app for Approval in the App Store, but linking with Growl is causing a validation error. I'm trying to re-codesign from the command line, but I'm getting the following error:

```
Ashs-MacBook-Pro:500px Uploader ash$ codesign -f -v -s "3rd Party Mac Developer Application: 500px Inc." ./Growl.framework/Versions/A
./Growl.framework/Versions/A: replacing existing signature
./Growl.framework/Versions/A: object file format unrecognized, invalid, or unsuitable

```

I've tried re-downloading the framework, but with no luck. Anybody see what I'm doing wrong?

Answer: 
Really strange, I've managed to resign the framework like this:

```
codesign -fs "3rd Party Mac Developer Application: Future Simple" Growl.framework/Versions/A/Growl
Growl.framework/Versions/A/Growl: replacing existing signature

```

(BTW: I'm working with Xcode 4.3.1 and Growl 1.3.1)
I just spent the day working through the "bundle format unrecognized, invalid, or unsuitable" error when codesigning a framework. In my case I'm using XCode 4.6.1 and I was trying to code sign Qt frameworks.

First note that the Apple documentation ([TN2206](http://developer.apple.com/library/mac/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-SUBSECTION9)) explicitly states that you need to code sign the versioned framework directory, not the library executable. 

This is discussed further here:
[How do you codesign framework bundles for the Mac App Store?](https://stackoverflow.com/questions/7697508/how-do-you-codesign-framework-bundles-for-the-mac-app-store)

So, based on that, the command line in Ash's original question is correct. However I was getting the same error.

I did get it working with that command line. Here are the things that I had to do:

* Make sure that you're using the correct version of CODESIGN\_ALLOCATE. This is discussed in many of the answers here: [iPhone Codesign object file format invalid or unsuitable](https://stackoverflow.com/questions/4842717/iphone-codesign-object-file-format-invalid-or-unsuitable) If you can get XCode to sign an app then you can find the CODESIGN\_ALLOCATE path in the build log.
* Make sure that the versioned directory (./Growl.framework/Versions/A in the question above) contains Resources/Info.plist and that there is a link from Versions/Current -> Versions/A and that there is a link Resources -> Versions/Current/Resources at the top level of the framework bundle. I found that I could not sign the versioned framework directory without the Versions/A/Resources/Info.plist being present. You can read more about the correct structure of a framework [here](https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html) and [here](https://stackoverflow.com/questions/6583121/is-there-any-documentation-for-building-os-x-frameworks-using-autotools), or just take a look at some system frameworks to get an understanding about how they're supposed to be structured.
* Further to the previous point, make sure that your symlinks in your framework bundle are structured correctly (Current links to numbered version, top level links to Current) as shown [in the Apple docs](https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html). This won't affect code signing but your App will be rejected if you don't get this right.
* Make sure that CFBundleExecutable is set to the correct name (the executable name) in your framework's Info.plist