skip to Main Content

That’s a common question that I already search for quite some time, but didn’t find a solution. So please if you can help me, i pretty much appreciate it, because I’m almost insane. Maybe the Xcode 13 is the problem, or the MacOS version, i don’t know anymore.

I’m getting the following error in the archive process in Jenkins:

    ** ARCHIVE FAILED **
The following build commands failed:
    CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler (in target 'lottie-ios' from project 'Pods')
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'lottie-ios' from project 'Pods')
    CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler (in target 'CryptoSwift' from project 'Pods')
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'CryptoSwift' from project 'Pods')
    CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler (in target 'Charts' from project 'Pods')
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Charts' from project 'Pods')
    CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler (in target 'Socket.IO-Client-Swift' from project 'Pods')
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Socket.IO-Client-Swift' from project 'Pods')
    CodeSign /Users/ec2-user/Library/Developer/Xcode/DerivedData/Digital-gcckbpuniqjuffdycaxavadslfdj/Build/Intermediates.noindex/ArchiveIntermediates/Digital/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Digital-Push.appex (in target 'Digital-Push' from project 'Digital')
(9 failures)

And that’s the in the gym log:

/usr/bin/codesign --force --sign DB14DD2701DF6BB1D23A6A554C4FDBA1FE9C1A56 --entitlements /Users/ec2-user/Library/Developer/Xcode/DerivedData/Digital-gcckbpuniqjuffdycaxavadslfdj/Build/Intermediates.noindex/ArchiveIntermediates/Digital/IntermediateBuildFilesPath/Digital.build/Release-iphoneos/Digital-Push.build/Digital-Push.appex.xcent --generate-entitlement-der /Users/ec2-user/Library/Developer/Xcode/DerivedData/Digital-gcckbpuniqjuffdycaxavadslfdj/Build/Intermediates.noindex/ArchiveIntermediates/Digital/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Digital-Push.appex
Warning: unable to build chain to self-signed root for signer "Apple Distribution: Banco BTG Pactual S.A. (FU2YTD6J36)"
/Users/ec2-user/Library/Developer/Xcode/DerivedData/Digital-gcckbpuniqjuffdycaxavadslfdj/Build/Intermediates.noindex/ArchiveIntermediates/Digital/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Digital-Push.appex: errSecInternalComponent
Command CodeSign failed with a nonzero exit code

Before running gym, I’m unlocking the keychain in both ways, direct and via fastlane:

security -v unlock-keychain -p $PASSWORD /Users/ec2-user/Library/Keychains/login.keychain
desc "Unlock keychain so jenkins can get authencation infos"
lane :keychain do
    UI.success("✅✅✅ Unlock keychain so jenkins can get authencation infos ✅✅✅")
    unlock_keychain(
        path: "login",
        password: @keychain_password
    )
end

It’s everything fine with my certs and keys, to the point everything is running smooth if i do the same process in Xcode and Fastlane via local terminal, it just happens in Jenkins.

The last thing, if it do makes some difference, is that the Jenkins workspace is out of the user directory, it’s in /opt/jenkins/workspace.

2

Answers


  1. In case anyone else has this issue, I had a similar error / scenario and found out that the server (we use a different product than Jenkins) was asking for permission to "sign" the archive and needed human input / the password of the user logged in.. I suspect to access the keychain. We also begin with unlocking the keychain so I’m not 100% sure why it was still asking for the password to do so manually. So the fix (at least in my scenario) was to log into the server and attempt an archive to give the password requested. After this, I had no issues.

    Login or Signup to reply.
  2. Open Keychain Access, double click on the key that is being used and go to the Access Control tab. Either allow access to all applications or just the application that needs to access, Jenkins in your case. Hope this helps. Refer this image

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search