Search Unity

Buid randomly failing in a non-deterministic way (copying assembly failed)

Discussion in 'Editor & General Support' started by cr4y, Aug 13, 2018.

  1. cr4y


    Jul 12, 2012
    We have a quite big game (build process takes 20-40 minutes). About a month ago some builds started to fail (in a non-deterministic way).
    I have created a batch script for building exactly same commit in a loop. About 50% builds are successful, about 50% failed.
    It happened already hundred of times on 5 different machines, on Unity 2018.1.5, 2018.1.6, 2018.1.9, 2018.2.1, 2018.2.2, 2018.2.3. We were not testing different versions.
    On each version up to 2.2 (when it was failing) the error was:

    Copying assembly from directory Temp to Library/ScriptAssemblies failed
    Error building Player because scripts had compiler errors

    On 2018.2.3 the error is more detailed:
    Copying assembly from 'Temp/Unity.Postprocessing.Runtime.dll' to 'Library/ScriptAssemblies/Unity.Postprocessing.Runtime.dll' failed".

    We were using PostProcessing from git (instead of package manager), so I've removed it completely from the project, added from the package manager, removed Library, obj, and Temp, tested on Unity 2018.1.9 and 2018.2.3 and it still sometimes fails with the same message.
    Unfortunately, I cannot attach the project, because it is big and commercial (it's a published game with hundreds of thousands of owners). The project is using AssetBundles and is not using the incremental compiler. Builds are being made in a batch mode but it sometimes does fail from normal editor also.

    Any advice will be highly appreciated!