Cant package game "Build Failed"

I have been unable to build my game for some time now, I don’t know what is causing it but I had this problem before and fixed it by creating a new project and migrating all the assets into the new one, this worked but is a big hassle so I don’t want to d that again if I can avoid it because I have bits of edited code to get multiplayer to work which I would have to re do every time.

Here is a section of the log which seemed like it could be relevant, does this shed any light on why its happening? I don’t understand much of this but I’m assuming its something to do with “AutomationTool was unable to run” whatever one of those is…

MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 253.9805269s to run UE4Editor-Cmd.exe, ExitCode=1
MainFrameActions: Packaging (Windows (64-bit)): InternalUtils.SafeCopyFile: SafeCopyFile C:\Program Files\Unreal Engine\4.8\Engine\Programs\AutomationTool\Saved\Cook.txt C:\Users\Jazz.Laurie-PC\AppData\Roaming\Unreal Engine\AutomationTool\C+Program+Files+Unreal+Engine+4.8\Cook.txt
MainFrameActions: Packaging (Windows (64-bit)): InternalUtils.SafeDeleteFile: SafeDeleteFile C:\Program Files\Unreal Engine\4.8\Engine\Programs\AutomationTool\Saved\Cook.txt
MainFrameActions: Packaging (Windows (64-bit)): Project.Cook: Cook failed. Deleting cooked data.
MainFrameActions: Packaging (Windows (64-bit)): ErrorReporter.Error: ERROR: AutomationTool error: Cook failed.
MainFrameActions: Packaging (Windows (64-bit)): BuildCommand.Execute: ERROR: BUILD FAILED
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: AutomationTool terminated with exception:
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: Exception in AutomationScripts.Automation: BUILD FAILED: Failed while running Cook for C:\Users\Jazz.Laurie-PC\Documents\Unreal Projects\DragonGame 4.8\DragonGame.uproject; see log C:\Users\Jazz.Laurie-PC\AppData\Roaming\Unreal Engine
MainFrameActions: Packaging (Windows (64-bit)): AutomationTool\C+Program+Files+Unreal+Engine+4.8\Cook.txt
MainFrameActions: Packaging (Windows (64-bit)): Stacktrace: at Project.Cook(ProjectParams Params)
MainFrameActions: Packaging (Windows (64-bit)): at BuildCookRun.DoBuildCookRun(ProjectParams Params)
MainFrameActions: Packaging (Windows (64-bit)): at BuildCommand.Execute()
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Automation.Execute(List1 CommandsToExecute, CaselessDictionary1 Commands)
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Automation.Process(String[] CommandLine)
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Program.MainProc(Object Param)
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Program.Main()
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: BUILD FAILED: Failed while running Cook for C:\Users\Jazz.Laurie-PC\Documents\Unreal Projects\DragonGame 4.8\DragonGame.uproject; see log C:\Users\Jazz.Laurie-PC\AppData\Roaming\Unreal Engine\AutomationTool\C+Program+Files+Unreal+
MainFrameActions: Packaging (Windows (64-bit)): Engine+4.8\Cook.txt
MainFrameActions: Packaging (Windows (64-bit)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: AutomationTool exiting with ExitCode=25
MainFrameActions: Packaging (Windows (64-bit)): Domain_ProcessExit
MainFrameActions: Packaging (Windows (64-bit)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (Windows (64-bit)): copying UAT log files…
MainFrameActions: Packaging (Windows (64-bit)): RunUAT.bat ERROR: AutomationTool was unable to run successfully.
MainFrameActions: Packaging (Windows (64-bit)): BUILD FAILED

Hey Cheese Dragon,

In order to better assist you, could you please upload the whole log as a .txt file to your next reply? I need to see the full log in order to see what’s going on.

Thanks!! :slight_smile:

yeah, my mistake, thought I had got the important bit there because I couldn’t see any “ERROR” above that but on further inspection me and another dev I am in contact with found that there were a lot of “failed to load” such and such an asset complaints. Gradually we worked though finding and sorting out the missing assets, usually a matter of deleting old models or nodes which were referencing assets which no longer exist. It Packages again fine now!

So a message to anyone else getting this error, if you want to delete something DO NOT PRESS THAT FORCE DELETE BUTTON either use REPLACE REFERENCE or sort out the thing that depends on it first, then delete!

Its kind of obvious but its all too easy just to delete something and never get around to fixing all the stuff that depended on it, and before you know it there is a whole matrix of stuff which works fine in editor but is secretly spewing out errors!