The cannot find code object on disk
error occurred on two of my projects after an update to Xcode 9.3.
Case 1: The issue was found to be CODE_SIGN_IDENTITY -
.
The fix was to change -
to something specific.
In the Xcode Project Inspector, "Code Signing Identity" becomes either Don't Code Sign
or some code sign identity.
Thus CODE_SIGN_IDENTITY
"-"
becomes either ""
(to not code sign) or a specific code sign identity.
Case 2: When using the Swift 4.1 development snapshot toolchain, the solution was to add a .xcconfig
Configurations Settings File to the Xcode project. The default CODESIGN_ALLOCATE
was set to the swift-4.1-DEVELOPMENT-SNAPSHOT-….xctoolchain/usr/bin path which does not contain the codesign_allocate
executable. The .xcconfig
can expressly set CODESIGN_ALLOCATE
for the build.
example.xcconfig
// file: example.config
CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate