Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

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

    sam_ettinger_sm

    Joined:
    Dec 1, 2016
    Posts:
    19
    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

    dannyd

    Unity Technologies

    Joined:
    Jun 3, 2014
    Posts:
    757
    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

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    181
    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") ?


    Thanks
     
unityunity