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

相关推荐
道法自然04022 天前
[CARLA系列--05]如何在Carla中去调用传感器模型--Radar篇
人工智能·自动驾驶·ue4
Kin__Zhang16 天前
随手记录 UE4/CARLA 仿真器 segmentation fault
android·java·ue4
小江村儿的文杰16 天前
UE4在MacOS上将Commit.gitdeps.xml设为Git LFS文件的潜在弊端
xml·ue4
李岱诚21 天前
epic商城下载,ue4报错处理
游戏引擎·ue4
爆米花煮鸡蛋21 天前
UE4.27生成sln时失败:Missing .../DotNET/UnrealBuildTool/UnrealBuildTool/UnrealBuildTool.exe after build
ue4
海中有金21 天前
UE4 内存池浅谈[3]——3代内存池对比总观
ue4·图形渲染
询问QQ:6882388622 天前
Labview交通灯程序设计——机动车道与人行道绿灯时间设置带报告
ue4
倾心唯恋23 天前
更新Epic后通过工程路径和Epic双击打不开UE4项目,提示Failed to launch editor的解决办法
ue4
2501_9389313323 天前
UE4SS-RE 安装全指南:基础环境变量设置到高级跨版本部署适配
ue4
小宝哥Code23 天前
UE5在布局自定义上的UE4ClassicLayout.ini文件源码解读分析
java·ue5·ue4