Xcode Cloud Fails to build: Command exited with non-zero exit-code: 70

Hi. I'm using Xcode Version 13.3 (13E113). I have a project that builds a MacOS app successfully in the GUI and from the command line using xcodebuild. It builds a universal binary that targets x86_64 and Apple Silicon.

When I try to build in Xcode Cloud I get four errors which all appear to be identical and which are:

Run command: 'set -o pipefail && source /Volumes/Task/ci_build.env && source /Volumes/Task/ci_plan.env && xcodebuild -exportArchive -archivePath /tmp/e8493b09-68f3-4226-8f89-5c00de477670.xcarchive -exportPath /Volumes/workspace/appstoreexport -exportOptionsPlist /Volumes/workspace/ci/app-store-exportoptions.plist '-DVTPortalRequest.Endpoint=http://100.118.8.40:8089' -DVTProvisioningIsManaged=YES -IDEDistributionLogDirectory=/Volumes/Task/logs/app-store-export-archive-logs -DVTSkipCertificateValidityCheck=YES -DVTServicesLogLevel=3 2>&1 | tee /Volumes/Task/logs/app-store-export-archive-logs/xcodebuild-export-archive.log'

Run command: 'set -o pipefail && source /Volumes/Task/ci_build.env && source /Volumes/Task/ci_plan.env && xcodebuild -exportArchive -archivePath /tmp/e8493b09-68f3-4226-8f89-5c00de477670.xcarchive -exportPath /Volumes/workspace/appstoreexport -exportOptionsPlist /Volumes/workspace/ci/app-store-exportoptions.plist '-DVTPortalRequest.Endpoint=http://100.118.8.40:8089' -DVTProvisioningIsManaged=YES -IDEDistributionLogDirectory=/Volumes/Task/logs/app-store-export-archive-logs -DVTSkipCertificateValidityCheck=YES -DVTServicesLogLevel=3 2>&1 | tee /Volumes/Task/logs/app-store-export-archive-logs/xcodebuild-export-archive.log'

I am unclear as to what this command is trying to do or why its running four times. It reports Command exited with non-zero exit-code: 70.

These commands appear in the build log under an item that says, Export archive for app-store distribution.

Note that I don't intend to distribute the app via the App Store right now. In this case, I just want to use Xcode Cloud to run CI jobs for my app when code is checked in and make the builds available to me and other people at my company.

Post not yet marked as solved Up vote post of brant Down vote post of brant
7.3k views
  • It appears related to an error:

    NSLocalizedDescription=exportOptionsPlist error for key "method": expected one of {}, but found development
  • Same here. In my case it's 6 (nearly) identical error message, two of which always report exactly the same error and this happens three times, one time for each configuration I use for different purposes (development/adhoc/appstore). The fact, that there are errors for development and adhoc as well, is actually also confusing, because the scheme I use for the only action within the workflow is for AppStore/TestFlight and by that, the workflow shouldn't know about development and adhoc at all.

    And one more thing: We have another similar project, which has different code, but nearly the same setup in matters of distribution/configurations/schemes/profiles which works fine. The difference between these two is, that the non-working one has two targets/artefacts, while its sister has only one (but the not-running workflow is setup to only produces one of the artefacts, of course).

Add a Comment

Replies

As I wrote in my comment, we ran into the same problem. After looking in the more detailed logs which are provided in AppstoreConnect/XCodeCloud, especially XYZBuild123/app-store-export-archive-logs/xcodebuil-export-archive.log (download "XCResult for..." from Build 123 -> Artefacts), we found that it said: error: exportArchive: Provisioning profile "iOS Team Store Provisioning Profile: xxxxxxxx" doesn't include the com.apple.smoot.subscriptionservice entitlement.

We need this entitlement and included it in our provisioning profiles. But it seems that Xcode doesn't use our own profiles, but a team profile created during build.

After deleting entitlement entries from the configurations and (just to be sure) deleting the .entitlements files completely the build ran.

However this is no solution, because we need those entitlement entries if we want to distribute our app, but at least we seem to have found the bug.

My situation is different but similar. I am building a Mac app that invokes a command line utility using NSTask. I am also building the command line utility. So I have it set up as a dependency and copied into my app bundle as an auxillary executable into the MacOS folder and then I locate it using NSBundle and run it with NSTask. If this executable is present, then the kind of Archive that is created when I "Archive" does not work with App Store Connect and Xcode Cloud fails. But if I remove the executable, Xcode Cloud builds and it creates the kind of archive that works with App Store Connect. And voila, it works with Xcode cloud. But alas, without that executable the app won't actually work. So unless Apple wants to support auxiliary executables invoked in this manner in Xcode cloud, I have to change how I'm building and deploying my app to work differently than it currently does. Or else build with Jenkins.

My scenario

  • I had merged a lot of changes from a branch (pull request)
  • I had also made changes to the swift package

Problem

Export archive for app-store distribution Command exited with non-zero exit-code: 70

Solution / Workaround

  • Cleared DerivedData
  • Cloned the project in a disk location