Build crashes when adding an extra gameplay module

I have this project that fails on building. When e.g. building it from Visual Studio I get the following message:

61013-capture.png

However, the specified dll file is in the Binaries/Win64 folder where it should be.
The exact same project compiles fine on another computer with the same (as far as I can tell) setup.

I narrowed it down to be a matter of adding a [gameplay module][2] .
I have tried with a minimal example where everything works fine until I add a gameplaymodule with a single class with a single constructor only writing an UE_LOG command.

This is really frustrating and any advise is much appreciated!

Did you add it into the xxx.Build.cs as module dependency?
Also try adding it to the .uproject file

{
	"FileVersion": 3,
	"EngineAssociation": "4.9",
	"Category": "Samples",
	"Description": "",
	"Modules": [
		{
			"Name": "ShooterGame",
			"Type": "Runtime",
			"LoadingPhase": "Default"
		},
		{
			"Name": "ShooterGameLoadingScreen",
			"Type": "Runtime",
			"LoadingPhase": "PreLoadingScreen"
		}
	],

Yes, I already added the xxx.Build.cs and and also did the .uproject as you specify. However, I now changed the loading phase of the gameplay module from Default to PreLoadingScreen, and now it works, thanks a lot!!

Not sure if this altogether solves the problem, but at least it works around it and makes the gameplay module work (Thanks to @lion032 ):

In the .uproject, in the gameplaymodule that fails, change the LoadingPhase from Default to PreLoadingScreen. In my case this made the build work smoothly!

You are welcome!

Yes this is correct I forgot to change it in my answer.