After signing my app with codesign I use to do a ‘codesign -vvv myapp’ to check it. This is what I get:
myapp.app: bundle format is ambiguous (could be app or framework)
In subcomponent: Builds - myapp.xojo_binary_project/Mac OS X (Cocoa Intel)/myapp.app/Contents/Frameworks/XojoFramework.framework
codesign says my bundle format is ambiguous.
codesign thinks your bundle looks a bit like an app and a bit like a framework.
Perhaps you have both Contents and Versions directories, or files in the top directory that match reserved names for directories in a bundle.
Perhaps there’s an Info.plist in an odd place.
In short, put everything in the correct places.
In the future; you can check to see if it’s an error with your code signing script by downloading the demo of App Wrapper and code signing there. If it works in App Wrapper, then you know it’s an issue with your script. If it doesn’t work in App Wrapper, then it’s most likely an issue with the signing process.
I found the problem, Dropbox. Pausing Dropbox while building the application is the solution. The target folder is in Dropbox and it looks like the Xojo Building and Dropbox syncing processes are not good friends.