I have just upgraded to XCode 6 and tried to build my Developer ID signed Mac app. However, I now get the following codesign error:
unsealed contents present
Have a look at OS X Code Signing In Depth
Beginning with OS X version 10.9.5, there will be changes in how OS X recognizes signed apps
Structure your bundle according to the expectations for OS X version 10.9 or later:
In my case, I was trying to sign an app with some old frameworks inside. None of these suggestions helped. Turned out I had to remove the PkgInfo file from inside a framework to get this message to go away.
I had the same problem and what worked for was deleting the contents of the DerivedData folder. Xcode doesn't say which resource is causing the problem, so I rebuilt everything from scratch. Clean didn't work either.
I have hit this twice now, so I am adding the causes, since codesign is very opaque and generally refuses to tell you what the problematic resource is.
On one occasion, I had an unsigned binary executable. Each executable and framework needs to be individually signed before singing the bundle as a whole.
Then I hit another case. I sign my code as part of the publish process, re-signing each executable and framework. But Xcode also signs the bundle as well, and it turns out that was leaving cruft behind in _CodeSignature folders. So now, before signing each of the executables and frameworks and then the bundle, I pre-remove Xcode's generated _CodeSignature folders with something like:
find MyApp.app -name _CodeSignature -type d -exec rm -rf {} +
Hopefully this hard-won information will save someone some time one day.
Another possible cause of this problem: if you are building iOS and macOS apps that have the same name and the same installed location, you may find that both of them are written into the same app bundle. First the iOS app build places its contents directly in the app bundle root, and then the macOS app build places its contents into a "Contents" folder in the app bundle, and then codesign complains about the iOS resources.
The problem is the version.txt
file that resides in the Dropbox.framework
. While this is useful to know which version the framework is, it seems no longer to be OK for codesigning.
When I removed the file everything worked fine again.