Search Unity

Unity Cloud Build keeps failing, builds fine locally

Discussion in 'Unity Cloud Build' started by AllonXR, Oct 17, 2018.

  1. AllonXR


    Jul 16, 2012
    I have been trying to make builds with Cloudbuild for iOS, Android and PC, but they always fail. I have followed the instructions regarding this issue ( and found that also my cloned projects build fine locally without any errors.
    I have tried to build projects that are completely empty, without any scripts or prefabs. They also fail.
    The Android and PC logs do show however a Null Reference Exception. This is not possible, at least not from my end, since these projects contain absolutely no references, objects or anything else.

    This is the last part of a failed PC build:

    51: [Unity] Finished exporting player successfully.
    52: [Unity] EXCEPTION: NullReferenceException: Object reference not set to an instance of an object
    53: [Unity] NullReferenceException: Object reference not set to an instance of an object
    54: [Unity] ERROR: executeMethod method UnityEditor.CloudBuild.Builder.Build threw exception.
    55: publishing finished successfully.
    56: Finished: FAILURE

    How can this problem be solved?
    One would think that Cloudbuild would be functional by now, so how can I make this work?
  2. ollieblanks


    Unity Technologies

    Aug 21, 2017
    Hi @AllonXR,

    I believe I have found your Project that you were testing Cloud Build with and see the errors that you have reported.

    I have attempted to reproduce the behaviour you are reporting with a brand new 2018.2.12f1 project, copying the configuration that you have and it built successfully.

    Can you please confirm whether running a "Clean Build" alleviates this issue?
  3. AllonXR


    Jul 16, 2012
    Hi ollieblanks,

    Thanks for your quick response.
    I just performed a Clean Build on the CloudTest project and received the same errors as before.
    Last edited: Oct 17, 2018
  4. Immu


    Jun 18, 2013
    @ollieblanks Same issue, personaly, I've been using Cloud build for some years properly, until this end of year.
    For about some time now (2018.3 beta maybe? Not sure, I had issue building with LWRP for some time too), all my cloud builds are containing issues on execution, build is successful, but on executing it, it's like my prefabs, for example, lost some of their bindings (null refs). I have to manually change their value, reset it to get sure the thing is resubmitted properly.

    But, still, it's like any of my 1000+ prefabs/objects have randomly started to lost some of their bindings. Fixing the nullrefs one by one (cloud build => download => execute look at the newly triggered error and see which new nullRef is triggered) is nearly impossible.

    Of course, my local builds works without any issue.
    I also tried to commit all my project by removing all of its content, then re-commiting it again by pasting the content inside again, no change.
  5. AlterRatione


    Mar 24, 2017
    I have to say I had that issue once this year, the only time I did a build using it to show the project to a client, and then had to redo the build locally so the problem wouldnt show.
  6. AllonXR


    Jul 16, 2012
    Hi @olliebanks,

    I'm glad it works on your side.
    Doing a Clean Build does not help me however, I still have the same issues.
    Frankly, I am at a loss as to what is going wrong here.
    Given the fact that the log insists there is a Null Reference Error, even when there are no objects or scripts in the project, added to the fact that no such errors exist when building locally, makes me think that the problem is on the Unity Server side.

    I hope you can find out what the problem is.

  7. dimib


    Apr 16, 2017
    Hi all,

    I also encountered this issue with Unity 2018.x up to 2019.1.3f1. all build and post processing steps are successful, but unity cloud build return failure:

    [Unity] Finished exporting player successfully.
    publishing finished successfully.
    uninstalling iOS credentials for mapstar-ag/mapstar5 - ios-development-build
    MAC verified OK
    Removing certificate...
    removing: /BUILD_PATH/Library/MobileDevice/Provisioning Profiles/567f3f14-97c5-4b05-b90d-8e864159fbf4.mobileprovision
    Zipping cache files from Library
    Build step 'Execute shell' marked build as failure
    postbuildstatus finished successfully.
    postbuildsteps finished successfully
    Finished: FAILURE
  8. FalconCGN


    Jan 18, 2014
    I am also having this issue...
    Everything seems to be working fine And then "Build step 'Execute shell' marked build as failure"
  9. victorw


    Unity Technologies

    Sep 14, 2016
    Those lines unfortunately do not tell us any of the specifics of the build failure, and will be present in most failures. What that line means is that the "Execute shell" step failed, and as a result of that the build was marked as having failed. Unfortunately that step is basically "everything which is not explicitly controlled directly by the UCB process" so it encompasses quite a lot of the execution.

    We would need to look at the rest of your build log to determine anything useful. Generally a good starting point is any error lines shortly before the build was marked as failed. With that said, I can see that for @dimib the error is occurring in iOS builds - we currently have a common issue with iOS builds affecting several customers. I'm hoping to release a fix for that issue later today, which may help to resolve your issue (although possibly it's separate, if it's occurring in Unity versions other than 2019.1.3f1)

    EDIT: The fix for the iOS issue is now deployed, try a fresh build and report back if it still persists
    Last edited: May 30, 2019
    technicat likes this.
  10. BigGameCompany


    Sep 29, 2016

    I'm having this same problem since upgrading to 2019 and the LWRP. Local builds work fine, clean cloud builds work fine, and normal cloud builds will complete without any errors but when I run the game I soon encounter a null object reference and it crashes. When I look at the logs I can see what it thinks is null, but when I check the prefabs they are always fine and have a reference set. Any tips? Thanks