Jenkins error: /usr/bin/codesign --force failed exit code 1 - ios

I am configuring CI for my IOS project on MAC yosemite-OS and got on problem:
error: /usr/bin/codesign --force --preserve-metadata=identifier,entitlements,resource-rules --sign /Users/mitul/Desktop/jenkins_ios_profile/PCertificates.p12 --resource-rules=/var/folders/rj/cc6d38nn53v6tk8y4jn7ghkr0000gp/T/42RbMszHQX/Payload/XXX.app/ResourceRules.plist /var/folders/rj/cc6d38nn53v6tk8y4jn7ghkr0000gp/T/42RbMszHQX/Payload/XXX.app failed with error 1
even my build and archive are getting success but not able to make .ipa file
even tried all possibilities from this
/usr/bin/codesign failed with exit code 1 but no luck
Please help me what I am missing to do
My Xcode configuration is as follows:
Custom xcodebuild arguments:
CODE_SIGN_RESOURCE_RULES_PATH=/Users/mitul/Public/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/ResourceRules.plist
rest are all with default setting

I unchecked the code signing checkbox in jenkins project configuration and it started building, hope it can help some else too!

Related

Can't build project - libswiftAVFoundation.dylib: errSecInternalComponent error: Task failed with exit 1 signal 0

Suddenly I can't build project.
I got this error upon building :
Products/Debug-iphoneos/MyApp.app/Frameworks/libswiftAVFoundation.dylib
/usr/bin/codesign '--force' '--sign'
'E5DD0B9344567811AABBF46F5AA802C26FAD6696' '--verbose'
'/Users/vlad/Library/Developer/Xcode/DerivedData/MyApp-aohzmfeceiyidabrejtgjtlfukvs/Build/Products/Debug-iphoneos/MyApp.app/Frameworks/libswiftAVFoundation.dylib'
/Users/vlad/Library/Developer/Xcode/DerivedData/MyApp-aohzmfeceiyidabrejtgjtlfukvs/Build/Products/Debug-iphoneos/MyApp.app/Frameworks/libswiftAVFoundation.dylib:
errSecInternalComponent error: Task failed with exit 1 signal 0 {
/usr/bin/codesign '--force' '--sign'
'E5DD0B9344567811AABBF46F5AA802C26FAD6696' '--verbose'
'/Users/vlad/Library/Developer/Xcode/DerivedData/MyApp-aohzmfeceiyidabrejtgjtlfukvs/Build/Products/Debug-iphoneos/MyApp.app/Frameworks/libswiftAVFoundation.dylib'
}
I tried to re-include Swift libraries but it didn't help.
This happened after I tried to connect to Firebase but then erased it from the pod file.
Anyone can tell me where the problem is and how to solve it?
Clean (shift + cmd + k)
Delete Derived data (click file -> workplace settings -> click the arrow under derived data and delete the entire folder)
Clean again
Rebuild

Jenkins return "unknown error -1=ffffffffffffffff" when building Xcode Project with Cocoapods

I'm getting below error when trying to build Xcode workspace on Jenkins
usr/bin/codesign --force --sign B5E96BDFADAF51D771B158A29BF1D16565215A2D --preserve-metadata=identifier,entitlements '/Users/servicebuild/Desktop/Jenkins/workspace/Hello-Branch/build/Hello Test.app/Frameworks/Alamofire.framework'
16:06:07 /Users/servicebuild/Desktop/Jenkins/workspace/Hello-Branch/build/Hello Test.app/Frameworks/Alamofire.framework: unknown error -1=ffffffffffffffff
16:06:07 Command /bin/sh failed with exit code 1
16:06:07
16:06:07 ** BUILD FAILED **
16:06:07
16:06:07
16:06:07 The following build commands failed:
16:06:07 PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/servicebuild/Library/Developer/Xcode/DerivedData/Hello-dcvxwbnovymfusbrvfyyekingznu/Build/Intermediates.noindex/Garanti\ Filo.build/Release-iphoneos/Hello\ Hello\ Test.build/Script-2617FEF7DE193736656550249B.sh
I have more than one targets and in workspace scheme targets that I created are ticked as shared (not the pod targets). In pod project every framework has "Don't Code Sign" (As Default). I can successfully get IPA export from Xcode. However, when I try to build in Jenkins I get this error.
I tried solution in below post but can't figure out. I think the problem is Jenkins is forcing to sign pods when It doesn't need to.
Codesign returned unknown error -1=ffffffffffffffff
I figured out how to run below code (posted in the post added in my question) and it worked. Important point is that giving right path for keychain and password. Otherwise, It doesn't work.
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k password ${KEYCHAIN}

iOS archive not working

I'm requesting your help to solve an archive issue for Apple iOS.
When I'm running the app with a local certificate everything is fine, but when I switch to archive (in order to publish it) I have an error.
Error is related with Alamofire and from what I consider with codesign
> Stripped
> /Users/..myuser../Library/Developer/Xcode/DerivedData/..myappname..-brxmobbquzmuhnbmcgzieifhgvjk/Build/Intermediates.noindex/ArchiveIntermediates/...myprojectname.../InstallationBuildProductsLocation/Applications//....app/Frameworks/Alamofire.framework/Alamofire
> of architectures: armv7 Code Signing
> /Users/...../Library/Developer/Xcode/DerivedData/......-brxmobbquzmuhnbmcgzieifhgvjk/Build/Intermediates.noindex/ArchiveIntermediates/..../InstallationBuildProductsLocation/Applications//.....app/Frameworks/Alamofire.framework
> with Identity iPhone Developer: name (code) /usr/bin/codesign --force
> --sign 7FEA49779804D0F60707E9954A90FE65C --preserve-metadata=identifier,entitlements '/Users/...../Library/Developer/Xcode/DerivedData/.....-brxmobbquzmuhnbmcgzieifhgvjk/Build/Intermediates.noindex/ArchiveIntermediates/...../InstallationBuildProductsLocation/Applications//.....app/Frameworks/Alamofire.framework'
> /Users/...../Library/Developer/Xcode/DerivedData/....-brxmobbquzmuhnbmcgzieifhgvjk/Build/Intermediates.noindex/ArchiveIntermediates/....../InstallationBuildProductsLocation/Applications//......app/Frameworks/Alamofire.framework:
> unknown error -1=ffffffffffffffff Command /bin/sh failed with exit
> code 1
Many thanks for your help
Solved.
Somehow the keychain password "login" was my problem. Changing it solved the signed issue. It was not related with Alamofire package.

Swift stdlib tool Error -> Task failed with exit 1 signal - IOS

I am trying to launch my developed app on my iphone and I am getting a build fail with the following error. I do not know how to address the problem. Please can someone advise? I can build the app on the simulator but not on the iphone.
error: Task failed with exit 1 signal 0 {
/usr/bin/codesign '--force' '--sign' 'CF34DF6AAC83D040CB9CA5907F171518DB7A331F' '--verbose' '/Users/johnDow/Library/Developer/Xcode/DerivedData/myApp-dfuggtbkfdkixtemtcsnzflclljy/Build/Products/Debug-iphoneos/myApp.app/Frameworks/libswiftCore.dylib'
}
Try to reset the derived Data
rm -rf /Users/johnDow/Library/Developer/Xcode/DerivedData/*
If that doesn't work I had to re install xcode AND restart computer to fix it

Command /usr/bin/codesign failed with exit code 1 Xcode CocoaPods

I've been trying to debug this error for hours, it says Command /usr/bin/codesign failed with exit code 1
Seems to involve the code signing, and I've refreshed provisioning profiles, removed Derived Data, cleaned the project, and tried everything else on SO but nothing works. Any help would be greatly appreciated. Here's the screenshot:
// Check those link i am sure you got your solution
Command /usr/bin/codesign failed with exit code 1
/usr/bin/codesign failed with exit code 1
command/usr/bin/codesign failed with exit code 1- code sign error

Resources