Our app contains several 3rd-party dylibs, which we've successfully bundled in our app and signed for Developer ID distribution many times. I just added a new 3rd-party dylib (libusd_ms.dylib, built from source) which expects to find a directory of resources (directory name "usd") in the .app/Contents/Frameworks directory. So I added the directory to my Copy Frameworks Build Phase with Code Sign On Copy checked.
Debug and Profile builds work as expected. Archived builds have the directory in /Frameworks. Checking the problem file (schema.usda) with codesign-d confirms it was signed in the Archive. But exporting the Archive to disk for distribution gives "Code Signing Failed" and points me to IDEDistributionPipeline.log, which reports:
2023-01-19 21:20:11 +0000 /var/folders/v3/j6lzlhcx34j_4v5w9_ztmfp80000gp/T/XcodeDistPipeline.~~~UzBjEy/Root/Applications/Reflex.app: code object is not signed at all
In subcomponent: /private/var/folders/v3/j6lzlhcx34j_4v5w9_ztmfp80000gp/T/XcodeDistPipeline.~~~UzBjEy/Root/Applications/Reflex.app/Contents/Frameworks/usd/usdShade/resources/usdShade/schema.usda
I confirmed by running codesign -d that the copy of that file in this "pipeline" folder is not signed, but how do I fix that if I've signed the original of the file in my app bundle?
Xcode 14.2 on macOS 13.1
which expects to find a directory of resources … in the
Contents/Frameworks
directory
Yeah, that’s not good. This runs counter to the rules described in Placing Content in a Bundle and, as it says at the top of that doc, “If you put content in the wrong location, you may encounter hard-to-debug code signing and distribution problems.”
Your best option is to move those resources to Content/Resources
and adjust the code to match.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"