其他错误
其他文章:
Jenkins(一)初步认识
Jenkins(二)自动化打包
Jenkins(三)其他错误
Jenkins(四)帮助
1、build发生的错误
[CJTestCIDemo] $ /usr/bin/agvtool vers -terse
No marketing version found (CFBundleVersion)
Technical version (CFBundleVersion) found in project configuration: .
Marketing version (CFBundleShortVersionString) used by Jenkins to produce the IPA:
Technical version (CFBundleVersion) used by Jenkins to produce the IPA:
Cleaning build directory: /Users/lichaoqian/Project/AutoPackaging/builds
FATAL: Unable to delete '/Users/lichaoqian/Project/AutoPackaging/builds'. Tried 3 times (of a maximum of 3) waiting 0.1 秒 between attempts.
错误信息的截图如下:
image.png
修改方法只需将
Build output directory中的路径改为$WORKSPACE下就可以。至于为什么其他目录下不可以,暂时不清楚。
image.png
2、ARCHIVE FAILED
** ARCHIVE FAILED **
The following build commands failed:
CompileStoryboard CJTestCIDemo/Base.lproj/Main.storyboard
CompileStoryboard CJTestCIDemo/Base.lproj/LaunchScreen.storyboard
(2 failures)
Build step 'Xcode' marked build as failure
Finished: FAILURE
错误信息的截图如下:
image.png
最后发现是编译问题,去掉safe area后,重新提交后,再构建就可以了。
image.png
3、ARCHIVE SUCCEEDED 但xxxExport.plist错误
** ARCHIVE SUCCEEDED **
Cleaning up previously generated .ipa files
Cleaning up previously generated .dSYM.zip files
Packaging IPA
FATAL: /Users/lichaoqian/Project/AutoPackaging/CJ/ad-hocFZ5YDHE5JZExport.plist
错误信息的截图如下:
image.png
修改方法只需将 Output directory中的路径改为$WORKSPACE下就可以。至于为什么其他目录下不可以,暂时不清楚。(这个与问题1中的Build output directory路径设置是一样的原因),即修改后为:
image.png
4、EXPORT FAILED
2018-01-16 17:00:44.747 xcodebuild[4385:839819] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7fd950ec4860>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
"Error Domain=IDEProvisioningErrorDomain Code=9 \"\"CJTestCIDemo.app\" requires a provisioning profile.\" UserInfo={NSLocalizedDescription=\"CJTestCIDemo.app\" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the \"provisioningProfiles\" dictionary in your Export Options property list.}"
)}
error: exportArchive: "CJTestCIDemo.app" requires a provisioning profile.
Error Domain=IDEProvisioningErrorDomain Code=9 ""CJTestCIDemo.app" requires a provisioning profile." UserInfo={NSLocalizedDescription="CJTestCIDemo.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}
** EXPORT FAILED **
Failed to build /Users/Shared/Jenkins/Home/workspace/CJTestCIDemo/AutoPackaging/package/Beyond.ipa
Build step 'Xcode' marked build as failure
Finished: FAILURE
错误信息的截图如下:
image.png image.png
错误原因分析参考:Xcode 9 在 Jenkins 自动打包脚本 中使用 Xcode integration 插件打包失败的原因
其中讲到的原因为:因为 Xcode 9 默认不允许访问钥匙串的内容,必须要设置 allowProvisioningUpdates 才会允许,但是由于 Xcode integration 插件封闭,并不能对其进行修改加上这个属性,所以决定使用 Shell 脚本代替插件
分析问题
直接用命令行打包
image.png
尝试用命令行直接打包Jenkins目录下的xcworkspae文件。我们先来看下不完善的命令:
所以输入如下命令
image.png
xcodebuild -archivePath "/Users/lichaoqian/Desktop/TestCI/CJTestCIDemo.xcarchive" -workspace "/Users/Shared/Jenkins/Home/workspace/CJTestCIDemo/CJTestCI/CJTestCIDemo/CJTestCIDemo.xcworkspae" -sdk iphoneos -scheme "CJTestCIDemo" -configuration "ad-hoc" archive
即
执行后,发现如下图错误:
image.png
分析结果是权限问题,所以我们在刚才执行的命令前面加上sudo
,即
image.png
此时,执行后没有上面的问题了,但是出现的问题,如下图:
image.png
之后我们用不是Jenkins目录下的CJTestCIDemo.xcworkspae实验,到底是不是证书,发现还是一样的问题。最后再sudo去掉,发现打包成功了。所以,Jenkins目录下的那个CJTestCIDemo.xcworkspae的打包,并不能通过添加sudo来解决。
网友评论