Download

Unable to Compile in 4.17, obscure UBT errors?

I’ve posted in multiple places now and still don’t have any idea what’s happening.

Answerhub
Another Answerhub
RyanJon’s forum post - Other users experiencing similar issues.

I used the Release branch on GitHub, but apparently some folks have been running into issues with the Launcher version of the Engine as well. Kind of desperate since I’m unable to do any work at the moment, since my branch is now up to 4.17. I have not been able to build my project once in 4.17, and I’ve tried all of the following:

  • Deleted Intermediatte, Binaries, Saved folders etc
  • Cleared Temporary Files
  • Restarted (duh)
  • Rebuild Solution Files
  • Rebuilt Engine
  • Tried a 4.17 default project (DOES compile)


1>------ Build started: Project: ECGame, Configuration: DebugGame_Editor x64 ------
1>  Performing full C++ include scan (building a new target)
1>  Creating makefile for ECGameEditor (no existing makefile)
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.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
1>     at UnrealBuildTool.UEBuildTarget.Build(BuildConfiguration BuildConfiguration, CPPHeaders Headers, List`1 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 DebugGame "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 ==========


EDIT:
Following Kamrann’s advice, I’ve tried to run UBT through Visual Studio with the following command line 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 in the log - which is pointing me to an error in a Microsoft file?!



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).


EDIT 2.0:
I’ve now stepped through UBT manually, and it’s taken me to here - which appears to be where the exception is thrown. Why do I feel like this is related to Plugin dependency changes in 4.17? My project uses plugins HEAVILY, and many of them are dependent on each other!

99175d22b019747a6c5a0b6efabe3ea365799c17.jpeg

I have Finally been able to resolve this, but I will say that finding this was a complete pain in the ***. I think this was caused by the Plugin dependency changes in 4.17. Code that previously compiled fine will now crash.

This .uplugin file was causing the problem:



{
	"FileVersion": 3,
	"Version": 1,
	"VersionName": "1.0",
	"FriendlyName": "ST Cascade Extensions",
	"Description": "Adds new modules to Cascade",
	"Category": "Stormtide.FX",
	"CreatedBy": "Stormtide Ltd.",
	"CreatedByURL": "www.stormtide.co.uk",
	"DocsURL": "",
	"MarketplaceURL": "",
	"SupportURL": "",
	"CanContainContent": false,
	"Modules": 
		{
			"Name": "ST_CascadeExtensions",
			"Type": "Runtime",
			"LoadingPhase": "PreDefault"
		},
		{
			"Name": "ST_CascadeExtensions",
			"Type": "Developer",
			"LoadingPhase": "PreDefault"
		},
		{
			"Name": "ST_CascadeExtensions",
			"Type": "Editor",
			"LoadingPhase": "PreDefault"
		}
	]
}


It should now look like this in 4.17:



{
	"FileVersion": 3,
	"Version": 1,
	"VersionName": "1.0",
	"FriendlyName": "ST Cascade Extensions",
	"Description": "Adds new modules to Cascade",
	"Category": "Stormtide.FX",
	"CreatedBy": "Stormtide Ltd.",
	"CreatedByURL": "www.stormtide.co.uk",
	"DocsURL": "",
	"MarketplaceURL": "",
	"SupportURL": "",
	"CanContainContent": false,
	"Modules": 
		{
			"Name": "ST_CascadeExtensions",
			"Type": "Runtime",
			"LoadingPhase": "PreDefault"
		}
	]
}