【问题标题】:Unreal Error: Game target is required with -cook or -cookonthefly虚幻错误:使用 -cook 或 -cookonthefly 需要游戏目标
【发布时间】:2021-05-14 14:59:19
【问题描述】:

在 Unreal Engine 4.26.2 上,我正在尝试为 Win64 打包 Blueprint/C++ 混合项目。

但是,我遇到了以下错误:

LogMainFrame: Project does not require temp target
LogLauncherProfile: Found promoted target with matching version at ../../../Engine/Binaries/Win64/UE4Game-Win64-Shipping.target
UATHelper: Packaging (Windows (64-bit)): Running AutomationTool...
UATHelper: Packaging (Windows (64-bit)): Parsing command line: -ScriptsForProject="C:/Users/Administrator/Documents/Unreal Projects/foo.uproject" BuildCookRun -nocompileeditor -installed -nop4 -project="C:/Users/Administrator/Documents/Unreal Projects/foo.uproject" -coo
k -stage -archive -archivedirectory=C:/Users/Administrator/Desktop/Win32UnrealBuilds -package -ue4exe="C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\Win64\UE4Editor-Cmd.exe" -ddc=InstalledDerivedDataBackendGraph -pak -prereqs -nodebuginfo -targetplatform=Win64 -clientconfig=Shipping -utf8output
UATHelper: Packaging (Windows (64-bit)): Setting up ProjectParams for C:\Users\Administrator\Documents\Unreal Projects\foo.uproject
UATHelper: Packaging (Windows (64-bit)): ERROR: Game target not found. Game target is required with -cook or -cookonthefly
UATHelper: Packaging (Windows (64-bit)):        (see C:\Users\Administrator\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.26\Log.txt for full exception trace)
PackagingResults: Error: Game target not found. Game target is required with -cook or -cookonthefly
UATHelper: Packaging (Windows (64-bit)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Windows (64-bit)): BUILD FAILED
PackagingResults: Error: Unknown Error

完整异常跟踪的相关部分是:

BuildCookRun.SetupParams: Setting up ProjectParams for C:\Users\Administrator\Documents\Unreal Projects\foo.uproject
InternalUtils.SafeFileExists: SafeFileExists C:\Users\Administrator\AppData\Local\Temp\UAT\C+Program+Files+Epic+Games+UE_4.26\Rules\UATRules24283721.dll=False
DynamicCompilation.RequiresCompilation: Compiling C:\Users\Administrator\AppData\Local\Temp\UAT\C+Program+Files+Epic+Games+UE_4.26\Rules\UATRules24283721.dll: Assembly does not exist
...
Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)

是否存在“找不到游戏目标”的常规原因?

【问题讨论】:

    标签: unreal-engine4 unreal-blueprint


    【解决方案1】:

    虽然不清楚它为什么起作用,但复制 Source 目录中的默认 projectname.Target.cs 文件并将其重命名为 projectnameGame.Target.cs(并更改该文件的内部类名以匹配)似乎可以诀窍。现在Source 目录中有3 个Target.cs 文件。

    • 项目名称.Target.cs
    • 项目名称Game.Target.cs
    • 项目名称Editor.Target.cs

    那时一切都恢复正常了……这看起来很奇怪,但确实有效!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-26
      • 2020-04-29
      • 2014-05-22
      • 2020-09-01
      • 2021-04-15
      • 2021-03-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多