iOS remembers to deal with continuous integration issues once

foreword

Recently, the company's continuous integration packaging machine has a problem and packaging has been failing. After a day of tossing, I finally got it done. I feel that I may encounter such problems in the future and record it.

problem performance

** 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

problem solving process

1. First of all, I searched for Command CodeSign failed with a nonzero exit code
insert image description here
and thought about it for a while, and no one moved the packaging machine. I suspect that it may be a problem with the certificate. I tried clean + restart, and to my surprise, it really worked. But after an hour, the office suddenly lost power. After restarting the packaging machine, the same error appeared again. This time I used the same solution again, and this time I will always report an error! ! ! !

2. According to the previous analysis, there must be a problem with the certificate, and I can successfully pack it by typing commands on the terminal, but it is not successful when I use Jenkins. Then I found that plug-ins can be added in Jenkins-"system management, I found the plug-in in the picture below. insert image description here
Configure the address after installation
insert image description here
Then I tried again with Jenkins and found that the packaging was successful. But this time there is a new problem. After the package is installed, it crashes after clicking. This makes people very speechless! ! !
3. Update all certificate configurations of ios, I deleted all certificates. Then reconfigured and tried packaging again and again, and finally solved it! !insert image description here

Guess you like

Origin blog.csdn.net/sky_long_fly/article/details/90701284