Search Unity

Issues with pre-export methods using Cloud Build Manifest

Discussion in 'Unity Cloud Build' started by sam_ettinger_sm, Dec 7, 2016.

  1. sam_ettinger_sm


    Dec 1, 2016
    Hey all, I want to gather some data from the Unity Cloud Build Manifest from within a pre-export method. Specifically, I'd like to collect the scmCommitId and buildNumber values so I can tie which Git commits become which builds. Unfortunately, all my attempted builds are failing and I can't determine why.

    The pre-export method I am using is *exactly* the method from the Unity Cloud Build Manifest guide linked above. I have that class saved to Assets/Scripts/CloudBuildHelper.cs, and in UCB Advanced Settings I have set the pre-export method name to CloudBuildHelper.PreExport. During the build, I get the following warning several times:

    787: [Unity] Assets/Scripts/CloudBuildHelper.cs(9,74): warning CS0618: `UnityEngine.CloudBuild.BuildManifestObject.GetValue(string, string)' is obsolete: `Use GetValue<type>(string, object) instead.'

    Then, eventually, I get this unhelpful error:
    1602: [Unity] ERROR: preExportMethod 'CloudBuildHelper.PreExport' failed, aborting.

    Has anyone run into similar problems? How did you solve them? Can someone kindly direct me to more recent/thorough/helpful examples of using the build manifest in pre-export methods?
  2. dannyd


    Unity Technologies

    Jun 3, 2014
    Responded about this in another thread, but just for others who come across this - scripts used for pre/post export need to be placed in an Editor/ folder in your project.
  3. Immu


    Jun 18, 2013
    Still getting in my cloud build:
    warning CS0618: 'BuildManifestObject.GetValue(string)' is obsolete: 'Use GetValue<type>(string) instead

    (my original line being manifest.GetValue("buildNumber"))

    I'm not sure how I should write that to avoid the warning. I didn't found much examples on the internet. Is it something like :

    manifest.GetValue<string>("buildNumber") ?