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 给去掉就好了。

相关推荐
清泓y1 天前
UE移动开发技术面试题
android·面试·ue5·ue4·游戏程序
清泓y1 天前
UE基础知识与引擎架构面试题
面试·架构·ue5·ue4·游戏程序
Duo1J5 天前
【UE】Slate 编辑器工具开发03 - 节点编辑器 (EdGraph)
ue5·编辑器·游戏引擎·ue4
学习!!!11 天前
针对虚幻引擎4中光线追踪内容兼容性的实用解决方案
ue4
Duo1J11 天前
【UE】Slate 编辑器工具开发01 - Slate语法 & 常用控件
ue5·编辑器·游戏引擎·ue4
DoomGT19 天前
UE5 - 制作游戏中切换窗口后游戏自动暂停功能
游戏·ue5·ue4·虚幻·虚幻引擎·unreal engine
Yuk丶2 个月前
厌倦了假AI对话?本地 LLM 语音对话 + 口型同步系统 2.0(已开源!)
c++·人工智能·语言模型·开源·ue4·语音识别·游戏开发
归真仙人2 个月前
【UE】LineTraceByProfile
ue5·游戏引擎·ue4·unreal engine
上山老人2 个月前
UE4布娃娃约束修改
ue4
Yuk丶2 个月前
厌倦了假AI对话?用本地大模型给UE注入真智能(已开源!)
c++·人工智能·开源·ue4·游戏程序·ue4客户端开发