Search Unity

FileNotFoundException: Could not load file or assembly 'UnityEngine.CloudBuild

Discussion in 'Unity Build Automation' started by thibouf, Jul 10, 2018.

  1. thibouf

    thibouf

    Joined:
    Mar 17, 2017
    Posts:
    105
    Hello,

    I get this warning message when building a project in unity cloud build :

    The following assembly referenced from /BUILD_PATH/ohm-games.baseball.android/Library/ScriptAssemblies/Assembly-CSharp-Editor-firstpass.dll could not be loaded:
    243: Assembly: UnityEngine.CloudBuild (assemblyref_index=7)
    244: Version: 1.0.6641.25722
    245: Public Key: (none)
    246: The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (/BUILD_PATH/ohm-games.baseball.android/Library/ScriptAssemblies/).
    247: Could not load file or assembly 'UnityEngine.CloudBuild, Version=1.0.6641.25722, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

    Then later

    283: [Unity] FileNotFoundException: Could not load file or assembly 'UnityEngine.CloudBuild, Version=1.0.6641.25722, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    284: [Unity] at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_method_info (intptr,System.Reflection.MonoMethodInfo&)
    285: [Unity] UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    286: [Unity] UnityEngine.DebugLogHandler:LogException(Exception, Object)
    287: [Unity] UnityEngine.Logger:LogException(Exception, Object)
    288: [Unity] UnityEngine.Debug:LogException(Exception)


    I am not sure it 100% linked, but I have a PreExport method called which depends on (UnityEngine.CloudBuild.BuildManifestObject) the compilation failed and so the full build as it can not found the PreExport method to call.

    My project is using Unity 2017.3.1f1 .
     
  2. HaakonL

    HaakonL

    Joined:
    Mar 13, 2014
    Posts:
    123
    Example preexport, dont forget to add the define.

    #if UNITY_CLOUD_BUILD
    using UnityEngine;
    using UnityEditor;
    using System;
    using System.IO;
    using System.Xml;

    public class CloudBuildHelper : MonoBehaviour
    {
    public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
    {
    PlayerSettings.bundleVersion = $"1.0.{manifest.GetValue("buildNumber", "0")}";
    }
    }
    #endif
     
  3. thibouf

    thibouf

    Joined:
    Mar 17, 2017
    Posts:
    105
    Thanks , but I don(t think that was my problem as it was in cloud build.

    Anyway, It just went away with no reason ... now it compile ...