Cooking fails after compiling C++ project code

I have a really strange problem with cooking the content for our project, which somehow seems to be related to our C++ project code. I have a working copy from SVN, which includes the “Binaries” folder. Now when I package the whole project in UE4 4.12.5 editor everything works well and without errors, the packaging process finishes successfully.

However, if I open the solution in Visual Studio 2015, clean and rebuild everything, then package again in the UE4 editor, the cooking process fails with the following output:


MainFrameActions: Packaging (Windows (64-bit)): Project.Cook: ********** COOK COMMAND STARTED **********
MainFrameActions: Packaging (Windows (64-bit)): Project.Cook: Cleaning cooked data.
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.RunCommandlet: Running UE4Editor Cook for project M:\Unreal\Projects\GlowRedux\GlowRedux.uproject
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.RunCommandlet: Commandlet log file is M:\Programs\Epic Games\4.12\Engine\Programs\AutomationTool\Saved\Cook-2016.07.10-16.37.51.txt
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: M:\Programs\Epic Games\4.12\Engine\Binaries\Win64\UE4Editor-Cmd.exe M:\Unreal\Projects\GlowRedux\GlowRedux.uproject -run=Cook  -TargetPlatform=WindowsNoEditor -fileopenlog -unversioned -cookall -abslog="M:\Programs\Epic 
MainFrameActions: Packaging (Windows (64-bit)): Games\4.12\Engine\Programs\AutomationTool\Saved\Cook-2016.07.10-16.37.51.txt" -stdout -FORCELOGFLUSH -CrashForUAT -unattended  -UTF8Output
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: LogInit:Display: Running engine for game: GlowRedux
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: LogInit:Display: RandInit(744716488) SRandInit(744716490).
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.52:884]  0]LogShaderCompilers:Display: Using Local Shader Compiler.
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.53:406]  0]LogDerivedDataCache:Display: Max Cache Size: 512 MB
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.53:479]  0]LogDerivedDataCache:Display: Loaded Boot cache: M:/Users/mfb/AppData/Local/UnrealEngine/4.12/DerivedDataCache/Boot.ddc
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.53:498]  0]LogDerivedDataCache:Display: Pak cache opened for reading ../../../Engine/DerivedDataCache/Compressed.ddp.
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:109]  0]LogTemp:Display: Loaded TP AllDesktopTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:119]  0]LogTemp:Display: Loaded TP WindowsClientTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:129]  0]LogTemp:Display: Loaded TP WindowsNoEditorTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:139]  0]LogTemp:Display: Loaded TP WindowsServerTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:150]  0]LogTemp:Display: Loaded TP WindowsTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:159]  0]LogTemp:Display: Loaded TP AndroidTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:166]  0]LogTemp:Display: Loaded TP Android_ASTCTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:177]  0]LogTemp:Display: Loaded TP Android_ATCTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:187]  0]LogTemp:Display: Loaded TP Android_DXTTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:198]  0]LogTemp:Display: Loaded TP Android_ETC1TargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:207]  0]LogTemp:Display: Loaded TP Android_ETC2TargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:225]  0]LogTemp:Display: Loaded TP Android_MultiTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:225]  0]LogTemp:Display: Loaded TP Android_PVRTCTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:226]  0]LogTemp:Display: Loaded TP HTML5TargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:248]  0]LogTemp:Display: Loaded TP IOSTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:257]  0]LogTemp:Display: Loaded TP TVOSTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:266]  0]LogTemp:Display: Loaded TP LinuxNoEditorTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:274]  0]LogTemp:Display: Loaded TP LinuxServerTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:285]  0]LogTemp:Display: Loaded TP LinuxTargetPlatform
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.54:285]  0]LogTargetPlatformManager:Display: Building Assets For WindowsNoEditor
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.55:119]  0]LogOutputDevice:Error: 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: begin: stack for UAT
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.55:119]  0]LogWindows:Error: === Critical error: ===
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: Fatal error!
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.07.10-14.37.55:119]  0]LogOutputDevice:Error: 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: end: stack for UAT
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 21,1292216s to run UE4Editor-Cmd.exe, ExitCode=3
MainFrameActions: Packaging (Windows (64-bit)): Project.Cook: Cook failed. Deleting cooked data.
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.AutomationException: Cook failed. ---> AutomationTool.AutomationException: BUILD FAILED: Failed while running Cook for M:\Unreal\Projects\GlowRedux\GlowRedux.uprojec
MainFrameActions: Packaging (Windows (64-bit)): t; see log M:\Users\mfb\AppData\Roaming\Unreal Engine\AutomationTool\Logs\M+Programs+Epic+Games+4.12\Cook-2016.07.10-16.38.12.txt
MainFrameActions: Packaging (Windows (64-bit)):    at AutomationTool.CommandUtils.RunCommandlet(FileReference ProjectName, String UE4Exe, String Commandlet, String Parameters)
MainFrameActions: Packaging (Windows (64-bit)):    at Project.Cook(ProjectParams Params)
MainFrameActions: Packaging (Windows (64-bit)):    --- End of inner exception stack trace ---
MainFrameActions: Packaging (Windows (64-bit)):    at Project.Cook(ProjectParams Params)
MainFrameActions: Packaging (Windows (64-bit)):    at BuildCookRun.DoBuildCookRun(ProjectParams Params)
MainFrameActions: Packaging (Windows (64-bit)):    at AutomationTool.BuildCommand.Execute()
MainFrameActions: Packaging (Windows (64-bit)):    at AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 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(Func`2 Main, Object Param)
MainFrameActions: Packaging (Windows (64-bit)):    at AutomationTool.Program.Main()
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: AutomationTool exiting with ExitCode=25 (Error_UnknownCookFailure)
MainFrameActions: Packaging (Windows (64-bit)): Domain_ProcessExit
MainFrameActions: Packaging (Windows (64-bit)): copying UAT log files...
MainFrameActions: Packaging (Windows (64-bit)): BUILD FAILED

There is only this falal error, but without any cause for why or where this error occurs. Strange thing is that this seems to be solely related to rebuilding the solution in Visual Studio, even if I don’t modify the C++ sources at all.

I am really out of ideas here, we are fighting with this since days :frowning:
Any ideas? I would really appreciate any feedback, ideas, solutions, whatever …

Thanks in advance!

Are you trying to run the cook while you are connected to vs? I’ve found that disconnecting the debugger usually fixes that issue.

No, I am starting the editor via Launchpad, then I start VS manually or via the UE4 editor menu option.

Hmm what if you remove the GlowRedux uasset that it seems to be complaining about?

This probably doesn’t relate to your problem, but I’ll throw it out there just in case it might help.

I just installed Update 3 for VS 2015 Community and had problems cooking for Windows in the editor afterwards.

After a bit of online research, I discovered that apparently the default Solutions Configuration of the newly installed VS update is something other than just plain “Development.” I reset this, rebuilt, and my “Missing UE4Game binary” cooking error went away.

You might consider changing your configuration just to make sure.

Ok guys, we finally managed to solve this issue.
Thank you very much for your ideas though.

For the records: The problem was a piece of our code, which compiled fine, but led to an error during runtime. Apparently UE4 runs the executable while cooking, but it doesn’t mention anything like that at the error message. I was able to track this bug down by looking at the folder Saved/Logs/ within our project directory. There you can find mini dumps, which you can open in Visual Studio. There I started debugging and in the callstack I could find the problematic function call in our code.

Easy to fix when you know where to look :slight_smile: