Jenkins无法导出app-store ipa

时间:2018-01-09 03:50:09

标签: ios xcode jenkins

ARCHIVE Process总是成功,但不是EXPORT process

这是事情,当导出类型为development时,它总是成功的。

但是当我将导出类型更改为app-store时,它就出错了。

这是错误信息。

10:01:52 ** ARCHIVE SUCCEEDED **
10:01:52 
10:01:52 Cleaning up previously generated .ipa files
10:01:52 Cleaning up previously generated .dSYM.zip files
10:01:52 Packaging IPA
10:01:52 [XCodeProj] $ /usr/libexec/PlistBuddy -c "Print :ApplicationProperties:CFBundleVersion" /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/XCodeProj/build/Release-iphoneos/Unity-iPhone.xcarchive/Info.plist
10:01:52 [XCodeProj] $ /usr/libexec/PlistBuddy -c "Print :ApplicationProperties:CFBundleShortVersionString" /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/XCodeProj/build/Release-iphoneos/Unity-iPhone.xcarchive/Info.plist
10:01:52 Packaging Unity-iPhone.xcarchive => /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/artifacts/jenkins-Release-app-store-364.ipa
10:01:52 [XCodeProj] $ /usr/bin/xcodebuild -exportArchive -archivePath /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/XCodeProj/build/Release-iphoneos/Unity-iPhone.xcarchive -exportPath /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/artifacts -exportOptionsPlist /Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/artifacts/app-store2477P575MMExport.plist
10:01:52 2018-01-09 10:01:52.598 xcodebuild[3570:174459] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/2w/320q_j1s5x10tmvq2rmwgx3c000086/T/Unity-iPhone_2018-01-09_10-01-52.597.xcdistributionlogs'.
10:01:53 2018-01-09 10:01:53.800 xcodebuild[3570:174459] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7f89ce77b200>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
10:01:53     "Error Domain=IDEProfileLocatorErrorDomain Code=1 \"No profiles for 'com.pantheon.artopia' were found\" UserInfo={NSLocalizedDescription=No profiles for 'com.pantheon.artopia' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS App Store provisioning profiles matching 'com.pantheon.artopia'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}"
10:01:53 )}
10:01:53 error: exportArchive: No profiles for 'com.pantheon.artopia' were found
10:01:53 
10:01:53 Error Domain=IDEProfileLocatorErrorDomain Code=1 "No profiles for 'com.pantheon.artopia' were found" UserInfo={NSLocalizedDescription=No profiles for 'com.pantheon.artopia' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS App Store provisioning profiles matching 'com.pantheon.artopia'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}
10:01:53 
10:01:53 ** EXPORT FAILED **

错误消息说我的应用程序没有合适的配置文件。

但我只为我的应用制作了两个应用商店分发配置文件,一个用于com.pantheon.artopia,另一个用于通配符。

我实际下载它们并将它们复制到jenkins的配置文件夹文件夹中。

它还建议将-allowProvisioningUpdates放到xcodebuild,我实际上是这样做的。

但最重要的是-allowProvisioningUpdates仅传递到archive步骤,而不传递到export步骤。

所以我怎么能解决这个问题,我需要你的建议。

我的jenkins设置为:enter image description here enter image description here enter image description here

1 个答案:

答案 0 :(得分:0)

最后,由于XCode9改变了它的导出策略,我修复了这个问题。

以下是我在XCode插件的General build settings中解决此问题的方法,只需取消选择步骤Pack application, build and sign .ipa?,然后添加一个Execute Shell步骤。

shell脚本很简单:

/usr/bin/xcodebuild -exportArchive -archivePath "/Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/XCodeProj/build/Debug-iphoneos/Unity-iPhone.xcarchive" -exportPath "/Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/artifacts" -exportOptionsPlist "/Users/Shared/Jenkins/Home/workspace/artopia/artopia-iOS/exportoptions/ExportOptions-"${ExportType}".plist" -allowProvisioningUpdates

您唯一应该提供的是exportoptions.plist,您可以在自己的XCode导出目录中找到它。

您可以在https://github.com/fastlane/fastlane/issues/9589

中找到更多信息