上海快风信息科技有限公司iOS调试技巧iOS备忘录

使用 Jenkins 持续集成 iOS 项目时碰到的一些问题

2017-06-02  本文已影响1781人  93b3d3ccb7e6

学习 Jenkins 时遇到很多的坑。。。把这些问题记录下来,避免再犯。

Q1

No iOS profile matching '8xxxxxx3@qq.com/yoxxxhu_Distribution' found:  Xcode couldn't find a profile 
matching '8xxxxxx3@qq.com/yoxxxhu_Distribution'. Install the profile (by dragging and dropping it onto 
Xcode's dock item) or select a different one in the General tab of the target editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.3'

A1

WX20170602-174826@2x.png WX20170602-174713@2x.png

还要确保已经将 /Users/管理员用户名/LibraryMobileDevice 文件夹拷贝到了 /Users/Shared/Jenkins/Library 下面


Q2

FATAL: No global development team or local team ID was configured.

A2

WX20170602-181236.png

Team ID 应填写这串字符,如图:

WX20170602-181556@2x.png

Q3


error: exportArchive: No valid iOS Development signing identities belonging to team CxxxxxxxxF were found.

Error Domain=IDEDistributionErrorDomain Code=1 "No valid iOS Development signing identities 
belonging to team CxxxxxxxxF were found." 
UserInfo={NSLocalizedDescription=No valid iOS Development signing identities 
belonging to team CxxxxxxxxF were found.}

A3

WX20170605-103630@2x.png WX20170605-104534@2x.png WX20170605-103525@2x.png

Password 是 Mac 开机时输入的密码

WX20170605-105813@2x.png WX20170605-105837@2x.png WX20170605-105928@2x.png WX20170605-105955@2x.png

Q4

No profiles for 'com.Gxxxxxc.SxxxM' were found:  Xcode couldn't find a 
provisioning profile matching 'com.Gxxxxxc.SxxxM'.
Code signing is required for product type 'Application' in SDK 'iOS 10.3'

A4

/Users/管理员用户名/LibraryMobileDevice 文件夹拷贝到 /Users/Shared/Jenkins/Library 下面


Q5

执行自动上传IPA到蒲公英的脚本时出错 fastlane: command not found

[H20170531_OCUnit] $ /bin/sh -xe /var/folders/9d/jrxjl4_14tj1w33z34jkrxjm0000gn/T/hudson4176251309376324428.sh
+ IPANAME=H20170531_OCUnit
+ fastlane gym --export_method ad-hoc --output_name H20170531_OCUnit
/var/folders/9d/jrxjl4_14tj1w33z34jkrxjm0000gn/T/hudson4176251309376324428.sh: 
line 3: fastlane: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE

A5

蒲公英 - 文档中心的解答:

这个情况一般是由于 jenkins 没有设置正确的 $PATH 环境变量导致的。正确设置的方法为:

蒲公英 - 文档中心链接: https://www.pgyer.com/doc/view/jenkins_ios


Q6

Check dependencies
The file “Pods-Swarm_swift.release.xcconfig” couldn’t be opened because there is no such file.
 (/Users/HW/.jenkins/workspace/SWARM/Pods/Target Support Files/Pods-Swarm_swift/Pods-Swarm_swift.release.xcconfig)

------

diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. 
Run 'pod install' or update your CocoaPods installation.

** ARCHIVE FAILED **

The following build commands failed:
    PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/HW/Library/Developer/Xcode/
DerivedData/Swarm_swift-gttgnsxyltckdlfnjucunmsdhnyx/Build/Intermediates/ArchiveIntermediates/
Swarm_swift/IntermediateBuildFilesPath/Swarm_swift.build/Release-iphoneos/Swarm_swift.build/
Script-E66BF0AC51C3B26C2CF625AA.sh

A6

#!/bin/bash -l
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
pod install --verbose --no-repo-update

此 shell 脚本要放在 Xcode 之前,如图:

WX20170605-170913.png

Q7

iOS 项目使用了 Cocoapods 时,执行 pod install 脚本报错:pod: command not found

+ pod install --verbose --no-repo-update
/var/folders/9d/jrxjl4_14tj1w33z34jkrxjm0000gn/T/hudson943803671821413828.sh: line 5: 
pod: command not found
Build step 'Execute shell' marked build as failure

A7

修改 shell 脚本如下:

#!/bin/bash -l
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
pod install --verbose --no-repo-update

export 语句将控制台语言环境设置为 UTF-8 格式,避免出现 Podfile 文件打开错误。


Q8

ERROR: Timeout after 10 minutes
ERROR: Error cloning remote repo 'origin'

A8

如图:

WX20170605-173713@2x.png

Q9

FATAL: Failed to copy /Users/Shared/Jenkins/Home/kpp_upload/SWARM_Development.mobileprovision to
/Users/HW/Library/MobileDevice/Provisioning Profiles/54xxxxxxxxxxd4.mobileprovision

java.io.FileNotFoundException: 
/Users/HW/Library/MobileDevice/Provisioning Profiles/54xxxxxxxxxxd4.mobileprovision 

A9

WX20170606-151737@2x.png

我研究了 Jenkins 3天左右,期间构建项目失败了40多次,内心几近崩溃 😂😂😂
而第一次构建项目成功并看到打包的IPA之后,心里却十分淡然...

上一篇下一篇

猜你喜欢

热点阅读