'Code Signing issue when Archiving using Fastlane in Github actions

Recently we have migrated all of our iOS projects from GitLab to GitHub. However when we are trying to build the code using GitHub Actions(Fastlane) In our self-hosted runners it keeps falling with error mentioned below.

When building(gym) the project it signs with correct certificates and profiles but when archiving it somehow uses the development certificate to sign the pods.

Command Executed:

set -o pipefail && xcodebuild -workspace ./{ProjectName}.xcworkspace -scheme UAT -destination 'generic/platform=iOS' -archivePath /Users/{user}/Library/Developer/Xcode/Archives/2022-05-03/{ProjectName}\ 2022-05-03\ 16.13.00.xcarchive -allowProvisioningUpdates clean archive | tee /Users/{user}/Library/Logs/gym/{ProjectName}-UAT.log | xcpretty

Note: It used to archive fine with Gitlab pipelines. Also, it builds fine when the commands are run manually on the hosted runner.

Code signing issue

Archive failed error

iOS: macOS Big Sur 11.6

XCode: 13.0 and 13.2.1

What we've tried:

  • Locking and Unlocking keychain.
  • Re-creation and re-installing certificates
  • Upgrading Ruby
  • Running on different machines(We have 2 runners)
  • Restarting and Cleaning the runners
  • Deintegrated and Integrated pods.


Solution 1:[1]

Did you try to pod install? The error indicates a problem with ur build phases script added by Cocoapods. maybe deintegrate and integrate Cocoapods again.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 hasan