UE4报错 Unable to instantiate UnrealEd module for non-editor targets

背景

UE4工程编译中,遇到下面报错:

2>UnrealBuildTool: Error : Unable to instantiate module 'UnrealEd': Unable to instantiate UnrealEd module for non-editor targets.

(referenced via Target -> CrossPlatformAutoTest.Build.cs -> MyGameGameplay.Build.cs -> AutomatedTesting.Build.cs)

分析与解决方案

这行报错位于:

// Engine\Source\Editor\UnrealEd\UnrealEd.Build.cs

public class UnrealEd : ModuleRules

{

public UnrealEd(ReadOnlyTargetRules Target) : base(Target)

{

if(Target.Type != TargetType.Editor)

{

throw new BuildException("Unable to instantiate UnrealEd module for non-editor targets.");

}

本身 UnrealEd 的含义就是 Editor 的意思,因此 无法在 non-editor 的目标中使用。

然后从报错去追踪 AutomatedTesting.Build.cs ,可以看到下面引用:

if (Target.Type == TargetRules.TargetType.Editor || Target.Type== TargetRules.TargetType.Client)

{

PrivateDependencyModuleNames.AddRange(new string[] { "UnrealEd", });

}

把 Client 给去掉就好了。

相关推荐
DoomGT12 天前
UE5 - C++项目基础
c++·ue5·ue4·虚幻·虚幻引擎·unreal engine
危险库14 天前
【UE4/UE5】在虚幻引擎中创建控制台指令的几种方法
c++·ue5·游戏引擎·ue4·虚幻
小江村儿的文杰15 天前
UE4通过打开DumpShader开关查看ShaderError的引用路径
ue4
FlyingMindIndex019 天前
UE_ContrlRig
ue5·ue4
HELLOMILI20 天前
[UnrealEngine] 虚幻引擎UE5下载及安装(UE4、UE5)
游戏·ue5·游戏引擎·ue4·虚幻·软件需求
pop_opo_21 天前
Unreal Engine 4.27 + AirSim 无人机仿真环境搭建:澳大利亚农村场景更换教程
ue4·无人机
小江村儿的文杰1 个月前
UE4 UAT 的六大流程 build cook stage pacakge archive deploy 与UAT的参数
ue4
小江村儿的文杰1 个月前
UE4 Rider调试时添加自定义命令行参数
ue4
小江村儿的文杰1 个月前
UE4 Mac构建编译报错 no template named “is_void_v” in namespace “std”
macos·ue4