Jenkins: Command /usr/bin/codesign failed with exit code 1

匿名 (未验证) 提交于 2019-12-03 01:34:02

问题:

I am able to archive ios project using below commands

cordova build ios --device --debug

and

cordova build ios --device --release

But when i try to do same from jenkins i am getting below error.

11:08:01 SecKey API returned: -25308, (null)/Users/Jenkins/Library/Developer/Xcode/DerivedData/GRC_Pulse-ebufuetkmalmfxbiegclmzuryhrm/Build/Intermediates/ArchiveIntermediates/GRC Pulse/InstallationBuildProductsLocation/Applications/GRC Pulse.app: unknown error -1=ffffffffffffffff 11:08:01 Command /usr/bin/codesign failed with exit code 1 11:08:01  11:08:01 ** ARCHIVE FAILED ** 11:08:01  11:08:01  11:08:01 The following build commands failed: 11:08:01    CodeSign /Users/Jenkins/Library/Developer/Xcode/DerivedData/GRC_Pulse-ebufuetkmalmfxbiegclmzuryhrm/Build/Intermediates/ArchiveIntermediates/GRC\ Pulse/InstallationBuildProductsLocation/Applications/GRC\ Pulse.app 11:08:01 (1 failure) 11:08:01 Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Jenkins/projects/grc-pulse-hybrid-custom/platforms/ios/cordova/build-debug.xcconfig,-workspace,GRC Pulse.xcworkspace,-scheme,GRC Pulse,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,GRC Pulse.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/Jenkins/projects/grc-pulse-hybrid-custom/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/Jenkins/projects/grc-pulse-hybrid-custom/platforms/ios/build/sharedpch 

回答1:

You should unlock your keychain before running the command when using ssh (connection from the master to a slave)

security unlock-keychain -p "" ${keychain}

Take a look on this link for more details



回答2:

I had this error with Xcode 8.3:

unknown error -1=ffffffffffffffff Command /usr/bin/codesign failed with exit code 1  ** ARCHIVE FAILED ** 

And

security unlock-keychain -p "mypass" ${mykeychain} 

solved it, too.



回答3:

I am going to chip in as well as I had to try a few more things than the ones mentioned here: the problem (for me) was that keychain doesn't like SSH sessions. I had to execute these in my session to fix it:

security unlock-keychain -p MY_PASS ~/Library/Keychains/login.keychain security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k MY_PASS ~/Library/Keychains/login.keychain security set-keychain-settings ~/Library/Keychains/login.keychain 

I've also removed my current certificates system/account certificates by removing my account from XCode (I use fastlane to do building) but I suspect that this shouldn't have impacted it.

This is now my third post about this or so but I sure hope it is going to help to save 8h of work for somebody...



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!