How to Codesign Growl.framework for Sandboxed Mac App
Asked Answered
T

4

4

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?

Tisbee answered 28/2, 2012 at 4:35 Comment(0)
A
3

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)

Azov answered 3/4, 2012 at 18:34 Comment(1)
I managed to resolve this issue by exporting my certificate and running the codesign on a coworker's computer. It must have been a problem with my keychain.Tisbee
B
2

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) 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?

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 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 and here, 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. 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

Bruns answered 9/8, 2013 at 8:59 Comment(0)
L
1

Would it be better if we shipped the sdk unsigned? It'd be a simple change, I'm hesitant to do so now since it's been like this for a little while.

Leitmotif answered 21/7, 2014 at 23:15 Comment(0)
T
0

It looks like the error might have been trying to sign a bundle that was already signed; I fixed the issue by downloading the Growl framework source and compiling it with my own signature instead.

If I find a better answer that will work for frameworks for which you don't have the ability to compile, I'll post it here.

Tisbee answered 28/2, 2012 at 19:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.