[Resolved] Can't Compile in 4.17

1>------ Build started: Project: ECGame, Configuration: Development_Editor x64 ------
1> Creating makefile for ECGameEditor (no existing makefile)
1> Performing full C++ include scan (no include cache file)
1>EXEC : error : System.ArgumentException: An item with the same key has already been added.
1> at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
1> at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) 1> at UnrealBuildTool.UEBuildTarget.Build(BuildConfiguration BuildConfiguration, CPPHeaders Headers, List1 OutputItems, List`1 UObjectModules, ActionGraph ActionGraph)
1> at UnrealBuildTool.UnrealBuildTool.RunUBT(BuildConfiguration BuildConfiguration, String[] Arguments, FileReference ProjectFile)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3075: The command “C:\UE4_Builds\UE4_Eclipse\Engine\Build\BatchFiles\Build.bat ECGameEditor Win64 Development “E:\P4\JBaxter_Work\Eclipse\Eclipse_Steam\ECGame\ECGame.uproject” -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Just updated my project to 4.17 - Release branch, and it refuses to compile. Tried on two different PC’s, cleared cached data and temporary files, rebuilt the solution and also followed some of the steps posted by other users regarding this issue.

Need a suggestion ASAP, pretty much a blocker right now :confused:

Okay so I’ve finally solved it. I will say -10 brownie points for utterly crap logging information on this one.

The problem was caused by two of my Plugins having multiple module types specified. In previous versions of the engine this would compile, but I guess it just causes crashes now.

Old code (ST_CascadeExtensions.uplugin)

	"Modules": [
		{
			"Name": "ST_CascadeExtensions",
			"Type": "Runtime",
			"LoadingPhase": "PreDefault"
		},
		{
			"Name": "ST_CascadeExtensions",
			"Type": "Developer",
			"LoadingPhase": "PreDefault"
		},
		{
			"Name": "ST_CascadeExtensions",
			"Type": "Editor",
			"LoadingPhase": "PreDefault"
		}
	]

New Code:

"Modules": [
	{
		"Name": "ST_CascadeExtensions",
		"Type": "Runtime",
		"LoadingPhase": "PreDefault"
	}
]

I would REALLY appreciate better logging here! Thanks to Kamrann for showing me how to step through.

May just be that UBT has been broken, but you’d at least be able to get some more info by running it in the debugger.

You can set the UnrealBuildTool project as your startup project in VS, then in its properties, Debugging tab, enter the command line arguments to point it to build your project. Hit F5 and it should break on the exception, letting you see exactly what line, and what it was trying to add to the dictionary when it failed.

Thanks, I’m trying to run it with the following options.

ECGameEditor Win64 DebugGame "C:\Users\Admin\Desktop\P4Manual\Eclipse\Eclipse_Steam\ECGame\ECGame.uproject" -waitmutex

I still don’t get any Breakpoints, but i do get this:

Creating makefile for ECGameEditor (Build.version is newer)
'UnrealBuildTool.vshost.exe' (CLR v4.0.30319: UnrealBuildTool.vshost.exe): Loaded 'D:\GIT\UnrealEngine\Engine\Intermediate\Build\BuildRules\UE4Rules.dll'. Symbols loaded.
'UnrealBuildTool.vshost.exe' (CLR v4.0.30319: UnrealBuildTool.vshost.exe): Loaded 'C:\Users\Admin\Desktop\P4Manual\Eclipse\Eclipse_Steam\ECGame\Intermediate\Build\BuildRules\ECGameModuleRules.dll'. Symbols loaded.
Exception thrown: 'System.ArgumentException' in mscorlib.dll
ERROR: System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at UnrealBuildTool.UEBuildTarget.Build(BuildConfiguration BuildConfiguration, CPPHeaders Headers, List`1 OutputItems, List`1 UObjectModules, ActionGraph ActionGraph) in D:\GIT\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 2384
   at UnrealBuildTool.UnrealBuildTool.RunUBT(BuildConfiguration BuildConfiguration, String[] Arguments, FileReference ProjectFile) in D:\GIT\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\System\UnrealBuildTool.cs:line 1396
The thread 0x2c30 has exited with code 0 (0x0).
The thread 0x2564 has exited with code 0 (0x0).
The program '[5628] UnrealBuildTool.vshost.exe' has exited with code 0 (0x0).

I’ve stepped through the code manually, and it’s taken me to here.

Why do I feel like this is related to Plugin dependency changes in 4.17?

Command looks fine, have you put that in the ‘Command line arguments’ box, and have ‘Start action’ set to “Start project”? If the debugger is attached properly to the UBT process you should definitely be getting a break. Try manually adding a breakpoint, maybe at the start of RunUBT in UnrealBuildTool.cs, and confirm that it gets hit.

Thanks for the report. This wasn’t a deliberate change. I will take a closer look.

Thanks Ben!

Hey Ben, any update on this?