Missing precompiled manifest for 'EditorWidgets' - cannot build Unreal Engine game without editor

When I build my game with editor (Unreal Engine 4.23), everything works just fine.

But when I try to do the build without editor (e.g. for packing it for Android/Windows), I get following error:

Missing precompiled manifest for 'EditorWidgets'. This module was most likely not flagged for being included in a precompiled build - set 'PrecompileForTargets = PrecompileTargetsType.Any;' in EditorWidgets.build.cs to override.	MyProject	H:\MyProject\Intermediate\ProjectFiles\UnrealBuildTool	1	

I am not sure what may cause EditorWidgets to get into way (if I understand correctly, it should not go to build without editor, but something is including it by mistake?).

MyProject.Build.cs looks like this:

using UnrealBuildTool;

public class HiraganaAcademy : ModuleRules
{

    public HiraganaAcademy(ReadOnlyTargetRules Target) : base(Target)
	{
        //PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

        //https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1603585-what-s-needed-for-using-c-17
        PCHUsage = PCHUsageMode.NoSharedPCHs;
        //PrivatePCHHeaderFile = "$pch.h";
        CppStandard = CppStandardVersion.Cpp17;
                         
        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG", "Slate", "SlateCore", "LevelSequence", "MovieScene" });

        PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore", "UnrealEd", "GenericGraphRuntime", "Json", "JsonUtilities","EditorStyle" });

    }

}

My MyProject.uproject:

{
	"FileVersion": 3,
	"EngineAssociation": "4.23",
	"Category": "",
	"Description": "",
	"Modules": [
		{
			"Name": "MyProject",
			"Type": "Runtime",
			"LoadingPhase": "Default",
			"AdditionalDependencies": [
				"UMG",
				"Engine",
				"CoreUObject",
				"GenericGraphRuntime",
				"Blutility"
			]
		}
	],
	"Plugins": [
		{
			"Name": "EditorScriptingUtilities",
			"Enabled": true
		}
	]
}

I also use GenericGraph Plugin with it’s GenericGraphRuntime.Build.cs (I believe this one is called):

using UnrealBuildTool;

public class GenericGraphRuntime : ModuleRules
{
	public GenericGraphRuntime(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

        PublicIncludePaths.AddRange(
			new string[] {
			}
			);

		PrivateIncludePaths.AddRange(
			new string[] {
				"GenericGraphRuntime/Private",
			}
			);

		PublicDependencyModuleNames.AddRange(
			new string[]
			{
				"Core",	"CoreUObject", "Engine",
			}
			);

		PrivateDependencyModuleNames.AddRange(
			new string[]
			{
                "Slate",
                "SlateCore",
                "GameplayTags"
            }
			);

		DynamicallyLoadedModuleNames.AddRange(
			new string[]
			{
			}
			);
	}
}

GenericGraph.unplugin:

{
	"FileVersion" : 3,
	"Version" : 1,
	"VersionName" : "1.0",
	"FriendlyName" : "Generic Graph Plugin",
	"Description" : "",
	"Category" : "GenericGraph",
	"CreatedBy" : "jinyuliao",
	"CreatedByURL" : "",
	"DocsURL" : "",
	"MarketplaceURL" : "",
	"SupportURL" : "",
	"EnabledByDefault" : true,
	"CanContainContent" : true,
	"IsBetaVersion" : false,
	"Installed" : false,
	"Modules" :
	[
		{
			"Name" : "GenericGraphRuntime",
			"Type" : "Runtime",
			"LoadingPhase" : "PreDefault"
		},
		{
			"Name" : "GenericGraphEditor",
			"Type" : "Editor",
			"LoadingPhase" : "Default"
		}
	]
}

From searching through Internet I noticed something about not using UFactory in build without editor? Is it enough to put it inside #if WITH_EDITORONLY_DATA ... #endif?

What about UEditorUtilityWidget?

What else classes/headers I should not include and how?

Hey, have you had any luck with sorting out this error? We have the same engine version and almost identical error, but with “EditorStyle” instead. Any help is appreciated!

Hey, we managed to solve this issue for our own project, so posting it here for anyone in the future.
We found this in relation to the problem with EditorStyle. But this might help here too.
https://answers.unrealengine.com/questions/900238/view.html

This helped our programmer figure out their next step. They opened our projects .uproject file and there was a umgeditor module in there, so they took it out and everything worked fine. Hope this helps someone.

@Solarsheep Hi, it was similar as in your answer. I am not recalling the exact library that made a problem but in general some module was intended to be editor only while it was still included.