简体   繁体   中英

CircleCI build fails because of CODE_SIGN_IDENTITY in xcodebuild command

I have inherited a project that uses Fastlane and CircleCI to generate builds. It has been broken for a while but I managed to get most of it working again. However the actual build keeps failing on the build server, locally all of my lanes already finish successfully.

I've been comparing what happens locally versus on the CI server and the difference seems to be in the way Circle archives the project. I've changed it so it will run locally and the errors remain the same:

xcodebuild -workspace ./App.xcworkspace -scheme App -configuration AdHoc -destination generic/platform=iOS -archivePath "/Users/me/Library/Developer/Xcode/Archives/2020-08-14/App 2020-08-14 13.08.37.xcarchive" archive "CODE_SIGN_IDENTITY=iPhone Distribution: ACME"

Results in:

error: No certificate for team '123ABC4DEF' matching 'iPhone Distribution: ACME' found: Select a different signing certificate for CODE_SIGN_IDENTITY, a team that matches your selected certificate, or switch to automatic provisioning. (in target '***********-SomeLibrary' from project '***********')

It looks like it wants to sign not only the main application using the CODE_SIGN_IDENTITY , expects 'iPhone Distribution: ACME' to be explicitly there and fails when it doesn't.

As soon as I remove the CODE_SIGN_IDENTITY part at the end it starts working locally:

xcodebuild -workspace ./App.xcworkspace -scheme App -configuration AdHoc -destination generic/platform=iOS -archivePath "/Users/me/Library/Developer/Xcode/Archives/2020-08-14/App 2020-08-14 13.08.37.xcarchive" archive"

I've been combing over all of the settings where this might be specified hardcoded but I couldn't find anything. GYM_CODE_SIGN_IDENTITY hasn't been added for example. So how is it possible that it doesn't add that CODE_SIGN_IDENTITY flag locally using Fastlane but yes remote on the server?

I've found out that it was a variable set up in the configuration of CircleCI:

https://app.circleci.com/settings/project/github/[your_org]/[your_app]/environment-variables

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM