iOS 记一次处理持续集成问题

前言

最近公司持续集成打包机器出了点问题打包一直失败。经过1天的折腾后终于搞定感觉以后有可能自己还会遇到此类问题记录一下。

问题表现

** ARCHIVE FAILED **


The following build commands failed:
CodeSign /Users/dabaomini/.jenkins/workspace/jlb-ios/branches/NewCompass/derivedData/Build/Intermediates.noindex/ArchiveIntermediates/Compass/InstallationBuildProductsLocation/Applications/JLBCompass.app
(1 failure)
[10:06:00]: Exit status: 65

+---------------+-------------------------+
|            Build environment            |
+---------------+-------------------------+
| xcode_path    | /Applications/Xcode.app |
| gym_version   | 2.123.0                 |
| export_method | ad-hoc                  |
| sdk           | iPhoneOS12.1.sdk        |
+---------------+-------------------------+

[10:06:00]:/usr/bin/codesign --force --sign 765427696AADCD99E3EF92F592527A33E6C06BFF --entitlements /Users/dabaomini/.jenkins/workspace/jlb-ios/branches/NewCompass/derivedData/Build/Intermediates.noindex/ArchiveIntermediates/Compass/IntermediateBuildFilesPath/Compass.build/Release-iphoneos/Compass.build/JLBCompass.app.xcent --timestamp=none /Users/dabaomini/.jenkins/workspace/jlb-ios/branches/NewCompass/derivedData/Build/Intermediates.noindex/ArchiveIntermediates/Compass/InstallationBuildProductsLocation/Applications/JLBCompass.app
[10:06:00]: ▸ Warning: unable to build chain to self-signed root for signer "iPhone Distribution: Hangzhou Jie Li Bang Technology Co., Ltd. (7T87C2R7MW)"
[10:06:00]:/Users/dabaomini/.jenkins/workspace/jlb-ios/branches/NewCompass/derivedData/Build/Intermediates.noindex/ArchiveIntermediates/Compass/InstallationBuildProductsLocation/Applications/JLBCompass.app: errSecInternalComponent
[10:06:00]: ▸ Command CodeSign failed with a nonzero exit code
[10:06:00]: 
[10:06:00]: ⬆️  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
[10:06:00]: ?  For the complete and more detailed error log, check the full log at:
[10:06:00]: ?  /Users/dabaomini/Library/Logs/gym/JLBCompass-Compass.log
[10:06:00]: 
[10:06:00]: Looks like fastlane ran into a build/archive error with your project
[10:06:00]: It's hard to tell what's causing the error, so we wrote some guides on how
[10:06:00]: to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[10:06:00]: Before submitting an issue on GitHub, please follow the guide above and make
[10:06:00]: sure your project is set up correctly.
[10:06:00]: fastlane uses `xcodebuild` commands to generate your binary, you can see the
[10:06:00]: the full commands printed out in yellow in the above log.
[10:06:00]: Make sure to inspect the output above, as usually you'll find more error information there
[10:06:00]: 
+------------------------------------+--------------------------------------------+
|                                  Lane Context                                   |
+------------------------------------+--------------------------------------------+
| DEFAULT_PLATFORM                   | ios                                        |
| PLATFORM_NAME                      |                                            |
| LANE_NAME                          | jenkins_build                              |
| SIGH_PROFILE_TYPE                  | ad-hoc                                     |
| MATCH_PROVISIONING_PROFILE_MAPPING | {"com.jlb.zxz"=>"match AdHoc com.jlb.zxz"} |
+------------------------------------+--------------------------------------------+
[10:06:00]: Error building the application - see the log above

+------+--------------------+-------------+
|            fastlane summary             |
+------+--------------------+-------------+
| Step | Action             | Time (in s) |
+------+--------------------+-------------+
| 1    | default_platform   | 0           |
| 2    | setup_jenkins      | 0           |
| 3    | Switch to pgy lane | 0           |
| 4    | match              | 2           |
| 5    | add_badge          | 1           |
| ?   | gym                | 152         |
+------+--------------------+-------------+

[10:06:00]: fastlane finished with errors

[!] Error building the application - see the log above
Build step '执行 shell' marked build as failure
Finished: FAILURE

问题解决过程

1.首先搜了一下 Command CodeSign failed with a nonzero exit code
在这里插入图片描述
想了一下,也没有人动打包机器,怀疑有可能是证书等问题。就clean +重启试了一下,让我惊讶的是果真搞定了。但是过了1个小时候后,办公室突然断电。打包机器重启后又出现同样的错误。这次又用了同样的解决方式,这次就永远的报错了!!!!

2.按照之前的分析肯定是证书有问题,而且我用在终端敲命令是可以打包成功的,但是用Jenkins就是打包不成功。然后就发现Jenkins-》系统管理 中可以添加插件,我找了一下下图这个插件。在这里插入图片描述
安装后配置地址
在这里插入图片描述
然后我用Jenkins又试了一遍发现打包成功了。可是这次又出现新的问题了,打出来的包安装后点击就崩溃了。这就让人很无语了!!!
3.更新ios 所有证书配置,我把所有的证书全删除了。然后重新配置了一遍又试了一遍打包,终于解决了!!在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值