Cloud build fails archiving, works locally on Mac

I get the following in my cloud build for iOS
31638: [xcode] /bin/sh -c /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-aootexuzfncnfjdcngcopjtygwtx/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Script-B4DA4BBC8D2ABC28EFCD5347.sh
31639: [xcode] Command /bin/sh failed with exit code 2
31640: [xcode] ** ARCHIVE FAILED **
31641: [xcode] The following build commands failed:
31642: [xcode] PhaseScriptExecution Process\ symbols /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-aootexuzfncnfjdcngcopjtygwtx/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Script-B4DA4BBC8D2ABC28EFCD5347.sh
31643: [xcode] (1 failure)

Unity version: latest 5.6
Xcode: latest
Source control: svn
Build target: iOS
Project name: Cuby Road

Note I also saw
Command /bin/sh failed with exit code 4
instead of code 2 in different builds

There is not much else signalling an error, besides an UnityEngine.Cloudbuild package related error which I also get in my Android build. The same project configuration used to build fine two weeks ago. And it goes fine on my mac, using the same certificate and provisioning profile.

What can go wrong here? Any advice is appreciated.

Is bitcode enabled?

No, it is turned off in the Post-Export Method, as all the extra bits are not really necessary for adhoc distribution. Both locally and in UCB it doesn’t make a difference; archiving locally succeeds, on UCB fails.

I’ve had my fair share of problems with cloudbuild, it just doesn’t seem a stable platform, if builds work locally, cloud build so far for me either doesn’t work or will build a really buggy build. I’d advice setting up your own automated system. Have a look at https://jenkins.io/ someone at work shown me this looks good but not got around to doing it myself yet.

We use Jenkins at the company I work for. It is indeed more stable than UCB, but I can’t afford setting it up for my own, requiring a Mac server up and running in order to build for iOS.

I get the same problem. wish I could dig deeper but all we get is that archiving failed

Hello,

UCB does not currently support Xcode 8.3, but this will be rolled out very soon. I will update this post when I have more info :slight_smile:

  • Sophia

@SophiaC Xcode 8.3 is what will result in a successful build, without the sole message of a failing archive? I wish I would get more info than the exit codes from the what seems a generated bash script.

@jorrit5477 Have you resolved this issue yet? Having the same problem with iOS cloud builds after upgrading to Unity 5.6.1f1. No problems with local iOS builds on Xcode 8.2.1 or Android. Seems to be the identical problem as well; either exit code 2 or 4 after attempting several builds. Is this an compatibility issue with Xcode 8.0 and 5.6.1?

13207:        [xcode]     /bin/sh -c /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-asylmiswvkgnlsarsitzexjsixiz/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Script-B29F44B085FE7B509D9FBB07.sh
13208:        [xcode] Command /bin/sh failed with exit code 4
13209:        [xcode] ** ARCHIVE FAILED **
13210:        [xcode] The following build commands failed:
13211:        [xcode]     PhaseScriptExecution Process\ symbols /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-asylmiswvkgnlsarsitzexjsixiz/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Script-B29F44B085FE7B509D9FBB07.sh
13212:        [xcode] (1 failure)

Hello all -
We’ve been tracking and working on this new iOS archiving error here. We’ve just made some changes which should help avoid the archiving failures which some iOS builds have been seeing recently; this error’s appearance has come as a surprise to the Cloud Build team as well, and it only affects some projects (which makes troubleshooting it a little more complicated).

Meanwhile we hope to make xcode8.3 available next week in Cloud Build, barring any more new compatibility issues. Thanks for your patience everyone.

Any update on this? I still have this problem. Unity 5.6.1p1

23237: [xcode] The following build commands failed:
23238: [xcode] PhaseScriptExecution Process\ symbols /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-dtpbenwqnywjctfqsqorcltvqeaa/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Script-841B42E2A3C19C58AB851401.sh

@jlanisdev sorry for the late reply, missed the forum alerts. No, this isn’t resolved yet.

@PhilMcJ @SophiaC I see in the logs XCode 8.3.2 is up and running on the build servers, but this has not yet been resolved. Do you have any update on this issue?

On our side the issue has been resolved. The steps I have executed:

  • Create an empty, new project
  • Copy over the ProjectSettings directory from this empty project to the one to build
  • Correct the project settings (player, quality, etc.)
  • Cleanup the project (remove older prototyping scenes, code, assets)

I could do this as the project settings are not modified that much (no tags, no layers, no physics, etc.). Since I have cleaned up a lot I can’t tell what was the actual thing that caused the failure of archiving.