OS X codesign failed: bundle format is ambiguous (could be app or framework)

This error can be caused by many things but I know about one more which I didn’t find anywhere else ;-).

In case you compile and deploy your app by using qtmacdeploy and sign your application immediately, everything will probably works fine. The problem occurs, when you need to copy your application to different location (for example during dmg building). In such cases, this error can occur:

bundle format is ambiguous (could be app or framework)

Althought codesign is executed as always, singing isn’t successful:

codesign --deep --force --verbose --sign "$SIGNNAME" ./Skipper.app
/path/Skipper.app/Contents/Frameworks/QtCore.framework: bundle format is ambiguous (could be app or framework)

The problem is, that during the copy it’s necessary to keep all symbolic links inside frameworks. Without this, singing will fail.

So instead of

cp -r ./Source ./Destination

it’s necessary to use

cp -R ./Source ./Destination

4 comments

  1. Would this be the case even if using ditto over cp?

    ex:

    ditto -c -k –sequesterRsrc –keepParent “$OUTPUT_DIR/$ARCHIVE_NAME/Products/Applications/$APPLICATION_NAME.app” “$OUTPUT_DIR/$APPLICATION_NAME.app.zip”

  2. Thanks for that. Hit this error and had just setup a copy files phase in the middle of the script. Knew issue was there somewhere, but -r/-R had not even hit the radar until I found this post. Probably saved me hours.

Leave a Reply

Your email address will not be published. Required fields are marked *