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

相关推荐
pop_opo_1 天前
Unreal Engine 4.27 + AirSim 无人机仿真环境搭建:澳大利亚农村场景更换教程
ue4·无人机
小江村儿的文杰19 天前
UE4 UAT 的六大流程 build cook stage pacakge archive deploy 与UAT的参数
ue4
小江村儿的文杰19 天前
UE4 Rider调试时添加自定义命令行参数
ue4
小江村儿的文杰21 天前
UE4 Mac构建编译报错 no template named “is_void_v” in namespace “std”
macos·ue4
小江村儿的文杰21 天前
理解UE4中C++17的...符号及enable_if_t的用法及SFINAE思想
数据结构·c++·ue4
小江村儿的文杰21 天前
UE4 Mac构建编译报错 no member named “disjunction” in namespace “std”
ue4
小江村儿的文杰22 天前
UE4 Rider如何直接调试PC DebugGame
ue4
DongDongBaJiaYou1 个月前
UE5打包,LoadObject加载不出网格|动画
ue5·ue4·虚幻·虚幻引擎
二DUAN帝3 个月前
UE实现路径回放、自动驾驶功能简记
人工智能·websocket·机器学习·ue5·自动驾驶·ue4·cesiumforue