Error: Failed with Exit Code 1

Trying to get my App Updated. Getting "Error: Failed with Exit Code 1". I get this Message:


/Users/"XCODE User"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftCore.dylib: code object is not signed at all

Codesigning /Users/"XCODE User"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-is/snhdfulltwo.app/Frameworks/libswiftCore.dylib
/usr/bin/codesign --force --sign E89ED6738A4C93319277F0DE1B85A8510D212F2A --verbose /Users/"XCODE User"/Library/Developer/Xcode/rivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftCore.dylib
/Users/"XCODE User"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftCore.dylib: errSecInternalComponent

error: Failed with exit code 1

It could be in my Code Signing Identity. Target is all 'iOS Developer'. Project is all iPhone Distribution: "Project Owner". Code Signing is "Automatic". Provisioning Profile is "Automatic". Using XCode 10.3. Even deleted XCode and re-installed it.


Any help appreciated.

Answered by maxman3789 in 374919022

Fixed it. I did Option - Command - Shift - K, which led to another Error: Command CodeSign failed with a nonzero exit code. I Googled that which led a StackOverflow page:


https://stackoverflow.com/questions/52421999/xcode-10-command-codesign-failed-with-a-nonzero-exit-code


It had instructions on resetting my Keychain Access. Thanks for the help.

Did you try to do an option-clean Build Folder ?

I went to Product - Clean Build Folder and still getting the Error. There's also this message that's comes up before the code posted above:


/Users/"XCODE User"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftCoreFoundation.dylib: code object is not signed at all

When I say option clean, I mean pressing Option key while selecting the menu item.

But the error you get may be due to a different origin.


Check the project signing.


- In the file browser of XCode, select the project (at the very top of the list, with the blue icon)

- On its right, select the project in TARGETS

- Select the General tab at top

- you should have a signing section:

What do you see here ? Any warning ?

You should checkbox Automatically manage signing


Does it solve the issue ?

"Automatically manage signing" is checked with the "Team Name" selected. I updated this app last year, so things in XCode probably changed since then. I also get this when I click the Error:


CopySwiftLibs /Users/"XCode User"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app (in target: snhdfulltwo)
    cd /Users/"XCode User"/Documents/Apps/snhdfulltwo
    export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
    export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk
    builtin-swiftStdLibTool --copy --verbose --sign E89ED6738A4C93319277F0DE1B85A8510D212F2A --scan-executable /Users/"XCode User"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/snhdfulltwo --scan-folder /Users/"XCode User"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks --scan-folder /Users/"XCode User"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/PlugIns --platform iphoneos --toolchain /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain --destination /Users/"XCode User"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks --strip-bitcode --resource-destination /Users/"XCode User"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app --resource-library libswiftRemoteMirror.dylib --strip-bitcode-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip --emit-dependency-info /Users/"XCode User"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Intermediates.noindex/snhdfulltwo.build/Debug-iphoneos/snhdfulltwo.build/SwiftStdLibToolInputDependencies.dep

also try quiting Xcode completely and restarting it.

Could you try to uncheck and chek again those signing parameters, reselect the team…

Did that. Didnt work. I also opened the project in XCode 11 Beta and getting the same Error

Wild speculation.....


>opened the project in XCode 11 Beta


Is it possible that having downloaded and installed XCode 11 Beta your XCode 10 installation has been confused in some way? Did this problem start only after you downloaded 11?

I've been using XCode 10.3. I thought XCode 11 Beta would make a difference, but it's not. Same Error. Here's what I get when I click the "Red Octagon":


CopySwiftLibs /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app (in target 'snhdfulltwo' from project 'snhdfulltwo')
    cd /Users/"USER"/Documents/Apps/snhdfulltwo
    export CODESIGN_ALLOCATE="/Users/"USER"/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate"
    export DEVELOPER_DIR="/Users/"USER"/Downloads/Xcode-beta.app/Contents/Developer"
    export SDKROOT="/Users/"USER"/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk"
    builtin-swiftStdLibTool --copy --verbose --sign E89ED6738A4C93319277F0DE1B85A8510D212F2A --scan-executable /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/snhdfulltwo --scan-folder /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusuf
nwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks --scan-folder /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/PlugIns --platform iphoneos --toolchain /Users/"USER"/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain --destination /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks --strip-bitcode --strip-bitcode-tool /Users/"USER"/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip --emit-dependency-info /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Intermediates.noindex/snhdfulltwo.build/Debug-iphoneos/snhdfulltwo.build/SwiftStdLibToolInputDependencies.d


libswiftObjectiveC.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftObjectiveC.dylib
libswiftQuartzCore.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftQuartzCore.dylib
libswiftCoreGraphics.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftCoreGraphics.dylib
libswiftDarwin.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftDarwin.dylib
libswiftDispatch.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftDispatch.dylib
libswiftFoundation.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftFoundation.dylib
libswiftCore.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftCore.dylib
libswiftCoreFoundation.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftCoreFoundation.dylib
libswiftCoreImage.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftCoreImage.dylib
libswiftUIKit.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftUIKit.dylib
libswiftos.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftos.dylib
libswiftMetal.dylib is up to date at /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftMetal.dylib
Probing signature of /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftObjectiveC.dylib
/usr/bin/codesign -r- --display /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftObjectiveC.dylib
/Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftObjectiveC.dylib: code object is not signed at all

Codesigning /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftObjectiveC.dylib
/usr/bin/codesign --force --sign E89ED6738A4C93319277F0DE1B85A8510D212F2A --verbose /Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftObjectiveC.dylib
/Users/"USER"/Library/Developer/Xcode/DerivedData/snhdfulltwo-gcolusufnwanpucbuotwpflksyqp/Build/Products/Debug-iphoneos/snhdfulltwo.app/Frameworks/libswiftObjectiveC.dylib: errSecInternalComponent

error: Failed with exit code 1 (in target 'snhdfulltwo' from project 'snhdfulltwo')

>Trying to get my App Updated.


Ignoring Xcode's jumble over corresponding errors that keeps coming back, I suspect your root issue is a franken-mix of swift versions.


Break things down to any 3rd party libs and what swift they're using vs. which Xcode you want to work with (pick just one), then sync them all up to latest Swift 5.x, option-clean that project and go again. Still no joy, create a new project with whichever latest Xcode you want to stick with and dump your existing/compatible code into it to make sure it's cruft-free.


Good luck.

FYI,


In Xcode 10 Apple removed the need to hold down the Option key to clean the build folder. Choosing Product > Clean Build Folder is now enough to clean the build folder.

They used clean for a long time, then they removed it, then they put it back, but AFAIK, a clean is still the same, meaning it tries to simpy delete the contents of that folder (usually a waste of time) vs. nuking the folder and it's contents. Pls. don't assume clean is useful in these examples.

Accepted Answer

Fixed it. I did Option - Command - Shift - K, which led to another Error: Command CodeSign failed with a nonzero exit code. I Googled that which led a StackOverflow page:


https://stackoverflow.com/questions/52421999/xcode-10-command-codesign-failed-with-a-nonzero-exit-code


It had instructions on resetting my Keychain Access. Thanks for the help.

Ah, keychain, interesting, thanks for the followup.

I do everything restarts Xcode, rebuild Project, adding toolChains, lock unlock them, but nothing works for me
so there are two possibilities
first, maybe you install the beta version of Xcode

or try this, this work for me->

I tried to run a project in Xcode12/Swift4, while the project was written on Xcode8/Swift3
so I install Xcode version 11.7 and run this work for me.

if you not done with 11.7 then install another version of Xcode and try the appreciated version
May this help you
Error: Failed with Exit Code 1
 
 
Q