Unreal Engine: Expecting to find a type to be declared in a module rules named

UnrealBuildTool looked for a ModuleRules class named after the module and did not find it. The module's .Build.cs file exists, but the class declared inside does not have the expected name, or the file is missing. The build stops before any compilation.

  • Blocking: the package fails
  • Build stage: UnrealBuildTool, ExitCode=8
  • Reproduced in our lab (UE 5.4.4 and 5.8.3)

Paste your log: find the cause in seconds Runs in your browser, nothing is uploaded.

What it looks like in your log

Excerpts from a reproduction in our lab (a test plugin, not a real product). Paths anonymized; line numbers are those of the original files.

Unreal Engine 5.4.4

Log.txt

Creating makefile for MyProjectEditor (manifest 'C:\Projects\MyProject\Intermediate\Build\Manifest-1-MyProjectEditor-Win64-Development.xml' not found)Total execution time: 1.86 secondsExpecting to find a type to be declared in a module rules named 'MyModule' in 'MyProjectModuleRules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.  This type must derive from the 'ModuleRules' type defined by UnrealBuildTool.Took 1.98s to run dotnet.exe, ExitCode=8UnrealBuildTool failed. See log for more details. (C:\Users\Dev\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_5.4\UBA-MyProjectEditor-Win64-Development.txt)AutomationTool exiting with ExitCode=8 (8)

ExitCode=8 is the final code of AutomationTool when UnrealBuildTool fails: the build stopped before the cook started. The cause is printed above, and in the UBA-*.txt file named in the message.

Unreal Engine 5.8.3

Log.txt

Expecting to find a type to be declared in a module rules named 'MyModule' in 'MyProjectModuleRules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.  This type must derive from the 'ModuleRules' type defined by UnrealBuildTool.Result: Failed (RulesError)Total execution time: 3.94 secondsTrace written to file C:\Users\Dev\AppData\Local\UnrealBuildTool\Trace.uba with size 1.5kbTook 4.17s to run dotnet.exe, ExitCode=8UnrealBuildTool failed. See log for more details. (C:\Users\Dev\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_5.8\UBA-MyProjectEditor-Win64-Development.txt)AutomationTool exiting with ExitCode=8 (8)

ExitCode=8 is the final code of AutomationTool when UnrealBuildTool fails: the build stopped before the cook started. The cause is printed above, and in the UBA-*.txt file named in the message.

Where the error comes from

Before compiling anything, UnrealBuildTool compiles every .Build.cs and .Target.cs file of the project and its plugins into one C# assembly, then looks for a class named exactly like each module. For a module named MyPlugin it expects public class MyPlugin : ModuleRules in MyPlugin.Build.cs.

In our lab, a plugin whose .Build.cs declared a class with another name produced this exact message on UE 5.4.4 and 5.8.3, followed by Result: Failed (RulesError). AutomationTool then stops with ExitCode=8: nothing is compiled or cooked.

Do not confuse it with "... in a target rules named ...": after a C# compile error such as error CS0101, UnrealBuildTool also fails to find the target rules. That line is a consequence; the first error is the cause.

Common causes

  • The class in <Module>.Build.cs is not named <Module> (for example after renaming a module by hand).
  • A plugin version built for another engine version.
  • An incomplete plugin copy (missing Source folder or .Build.cs).

How to fix it

  1. Open the .Build.cs file of the module and check that the class is declared as public class <Module> : ModuleRules, with exactly the module name.
  2. If the module belongs to a third-party plugin, remove it completely and reinstall the version made for your exact engine version.
  3. Check that the plugin is installed only once (project Plugins folder or engine Plugins folder, not both).
  4. Delete the project's Binaries and Intermediate folders, regenerate project files, and package again.

Questions

Which log contains the full error?

UnrealBuildTool writes it in UBA-<Target>-<Platform>-<Configuration>.txt, in the AutomationTool logs folder. AutomationTool also copies the line into Log.txt.

What does ExitCode=8 mean here?

UnrealBuildTool failed, so packaging stopped at the build stage, before the cook.

Can it be caught before cooking?

Yes, it can be checked before you start a cook: Check that every module listed in each .uplugin has a matching .Build.cs.

Reports and sources

Decode your log

Paste your packaging log, or drop Log.txt with Cook-*.txt / UBA-*.txt. The analysis runs in your browser: the log is never uploaded.

Get notified when the in-editor plugin launches

The same decoder inside the Unreal Editor, with checks that catch these errors before you cook.