karthikeayan
karthikeayan

Reputation: 5000

iOS Build from Jenkins Xcode plugin failing

I am not an iOS expert, but using Xcode plugin build the iOS app written in React Native.

I am facing the below error, I have tried all the solutions mentioned in stackoverflow and other blogs/articles. I have the certificates in Keychain. None of the solutions worked for me.

Signing Identity:     "iPhone Developer: XXXXX (YYYYYY)"
Provisioning Profile: "iOS Team Provisioning Profile: com.xxx.xxx.mobile"
                      (xxxxxxxxxx)

    /usr/bin/codesign --force --sign xxxxxxxxxxxxxxxxxxxxxxxxx --entitlements /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/MYPROJECT-fxxxxxxxxxxxxxxxxxxxxxxxx/Build/Intermediates.noindex/ArchiveIntermediates/MYPROJECT/IntermediateBuildFilesPath/MYPROJECT.build/Debug-iphoneos/MYPROJECT.build/MYPROJECT.app.xcent --timestamp=none /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/MYPROJECT-fxxxxxxxxxxxxxxxxxxxxxxxx/Build/Intermediates.noindex/ArchiveIntermediates/MYPROJECT/InstallationBuildProductsLocation/Applications/MYPROJECT.app
/Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/MYPROJECT-fxxxxxxxxxxxxxxxxxxxxxxxx/Build/Intermediates.noindex/ArchiveIntermediates/MYPROJECT/InstallationBuildProductsLocation/Applications/MYPROJECT.app: errSecInternalComponent
Command /usr/bin/codesign failed with exit code 1

** ARCHIVE FAILED **


The following commands produced analyzer issues:
    Analyze Base/RCTModuleMethod.mm normal arm64
    Analyze RCTNetInfo.m normal arm64
(2 commands with analyzer issues)

The following build commands failed:
    CodeSign /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/MYPROJECT-fxxxxxxxxxxxxxxxxxxxxxxxx/Build/Intermediates.noindex/ArchiveIntermediates/MYPROJECT/InstallationBuildProductsLocation/Applications/MYPROJECT.app
(1 failure)

Jenkins: 2.164.2

Xcode Integration Plugin: 2.0.11

Xcode: 10.2

Upvotes: 0

Views: 360

Answers (1)

Kazuhide Takahashi
Kazuhide Takahashi

Reputation: 11

If Jenkins is running in the background with launchctl etc., which account is Jenkins running on? You need to be careful.

Even if Jenkins is running under your account, if you are running in the background with launchctl etc., you need to use the security command to give access to the keychain to the session running in the background.

Or you need to unlock the keychain with the option of Xcode Plugin.

The recommended method is to import the developer certificate, private key and provisioning profile exported from Xcode using Xcode Plugin Developer Profile import prior to build.

Upvotes: 1

Related Questions