UE4.20.1: BuildException: UBT ERROR: Failed to produce item

Problem

This problem happen when I am trying to create a new C++ Basic Code project

Logs

<>c.<PrintExceptionInfo>b__4_1: ==============================================================================
<>c.<PrintExceptionInfo>b__4_0: UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: C:\Projects\unreal\vr001\Binaries\Win64\UE4Editor-vr001.dll
<>c.<PrintExceptionInfo>b__4_0:                         (see ../Programs/UnrealBuildTool/Log.txt for full exception trace)
<>c.<PrintExceptionInfo>b__4_1: 
<>c.<PrintExceptionInfo>b__4_1: BuildException: UBT ERROR: Failed to produce item: C:\Projects\unreal\vr001\Binaries\Win64\UE4Editor-vr001.dll
<>c.<PrintExceptionInfo>b__4_1:    at UnrealBuildTool.ActionGraph.ExecuteActions(BuildConfiguration BuildConfiguration, List`1 ActionsToExecute, Boolean bIsRemoteCompile, String& ExecutorName, String TargetInfoForTelemetry, EHotReload HotReload) in D:\Build\++UE4\Sync\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\ActionGraph.cs:line 570
<>c.<PrintExceptionInfo>b__4_1:    at UnrealBuildTool.UnrealBuildTool.RunUBT(BuildConfiguration BuildConfiguration, String[] Arguments, FileReference ProjectFile, Boolean bCatchExceptions) in D:\Build\++UE4\Sync\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 1673
<>c.<PrintExceptionInfo>b__4_1: ==============================================================================
UnrealBuildTool.RunUBT: Total build time: 152.90 seconds (Parallel executor: 0.00 seconds)

Full log: [https://www.pastiebin.com/5b6fb672c3390][1]

Visual Studio Installation:

Summary

  • Visual Studio core editor
  • Desktop development with C++
  • Game development with C++
  • Individual components
    • Windows 10 SDK (10.0.17.134.0)

Attempted

.

Existing issues:

The issue below has a similar error message to mine, but their full trace are not similar to mine.

I manage to resolve the problem. I believe my Windows 10 SDK 10.0.16299.0 is corrupted. So, I deleted my local copy of 10.0.16299.0 and replace it from winsdk-10/Include/10.0.16299.0 at 9b69fd26ac0c7d0b83d378dba01080e93349c2ed · tpn/winsdk-10 · GitHub

Repair / reinstalling from Visual Studio Installer doesn’t seem to fix my problem.

Solution

So I ended up doing this instead:

Obtain new copy of 10.0.16299.0

  1. Delete C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0
  2. Replace it with the copy I got from GitHub - tpn/winsdk-10

.

Resetup unreal project

  1. Delete Binaries, Intermediate and Saved from my project folder
  2. Reopen my uproject (i.e. vr001.uproject)
  3. Accept rebuilding

I’ve noticed a lot of times the compiler does this really cool thing where it deletes a handful of necessary build files for UE4, many times this can be corrected by verifying UE4 through the Epic Games Launcher.