Unreal Error: Game target is required with -cook or -cookonthefly
Unreal Error: Game target is required with -cook or -cookonthefly
在 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)
命中“未找到游戏目标”是否有常规原因?
虽然不清楚它为什么起作用,但复制 Source
目录中的默认 projectname.Target.cs 文件并将其重命名为 projectnameGame.Target.cs(同时更改内部 class 名称该文件匹配)似乎可以解决问题。 Source
目录中现在有 3 个 Target.cs
文件。
- projectname.Target.cs
- projectnameGame.Target.cs
- projectnameEditor.Target.cs
那时一切都恢复正常了...这看起来很奇怪,但确实有效!
在 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)
命中“未找到游戏目标”是否有常规原因?
虽然不清楚它为什么起作用,但复制 Source
目录中的默认 projectname.Target.cs 文件并将其重命名为 projectnameGame.Target.cs(同时更改内部 class 名称该文件匹配)似乎可以解决问题。 Source
目录中现在有 3 个 Target.cs
文件。
- projectname.Target.cs
- projectnameGame.Target.cs
- projectnameEditor.Target.cs
那时一切都恢复正常了...这看起来很奇怪,但确实有效!