Packaging Error: AutomationTool exiting with ExitCode=1

I tried to package my game with an error and the following output log:

UATHelper: Packaging (Windows (64-bit)): Running AutomationTool...
UATHelper: Packaging (Windows (64-bit)): Automation.ParseCommandLine: Parsing command line: -ScriptsForProject="C:/UnrealProjects/StruggleOfMages 4.16/StruggleOfMages.uproject" BuildCookRun -nocompileeditor -nop4 -project="C:/UnrealProjects/StruggleOfMages 4.16/StruggleOfMages.uproject" -cook -stage -archive -archivedirectory=C:/Users/Saden/Desktop -package 
-clientconfig=Shipping -ue4exe=UE4Editor-Cmd.exe -clean -pak -prereqs -distribution -targetplatform=Win64 -build -CrashReporter -utf8output -compile
UATHelper: Packaging (Windows (64-bit)): ScriptCompiler.FindAndCompileScriptModules: Compiling scripts.
UATHelper: Packaging (Windows (64-bit)): MSBuild:   DotNETUtilities -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\DotNETUtilities.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   UnrealBuildTool -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\UnrealBuildTool.exe
UATHelper: Packaging (Windows (64-bit)): MSBuild:   AutomationUtils.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationUtils.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   AllDesktop.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\AllDesktop\AllDesktop.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   Localization.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\Localization.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   OneSkyLocalization.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\OneSkyLocalization.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   AutomationScripts.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\AutomationScripts.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   Android.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\Android\Android.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   BuildGraph.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\BuildGraph.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   HTML5.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\HTML5\HTML5.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   MobileDeviceInterface -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\IOS\MobileDeviceInterface.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   IOS.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\IOS\IOS.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   Linux.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\Linux\Linux.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   Mac.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\Mac\Mac.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   TVOS.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\TVOS\TVOS.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   Win.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\Win.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   XLocLocalization.Automation -> C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Binaries\DotNET\AutomationScripts\XLocLocalization.Automation.dll
UATHelper: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 7,5324861s to run MSBuild.exe, ExitCode=0
UATHelper: Packaging (Windows (64-bit)): BuildCookRun.SetupParams: Setting up ProjectParams for C:\UnrealProjects\StruggleOfMages 4.16\StruggleOfMages.uproject
UATHelper: Packaging (Windows (64-bit)): Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.AutomationException: Game target not found. Game target is required with -cook or -cookonthefly
UATHelper: Packaging (Windows (64-bit)):    bei AutomationTool.ProjectParams.AutodetectSettings(Boolean bReset) in C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\AutomationUtils\ProjectParams.cs:Zeile 1846.
UATHelper: Packaging (Windows (64-bit)):    bei AutomationTool.ProjectParams..ctor(FileReference RawProjectPath, BuildCommand Command, String Device, String MapToRun, String AdditionalServerMapParams, ParamList`1 Port, String RunCommandline, String StageCommandline, String BundleName, String StageDirectoryParam, String UE4Exe, String SignPak, List`1 ClientCo
nfigsToBuild, List`1 ServerConfigsToBuild, ParamList`1 MapsToCook, ParamList`1 MapIniSectionsToCook, ParamList`1 DirectoriesToCook, String InternationalizationPreset, ParamList`1 CulturesToCook, ParamList`1 ClientCookedTargets, ParamList`1 EditorTargets, ParamList`1 ServerCookedTargets, List`1 ClientTargetPlatforms, Dictionary`2 ClientDependentPlatformMap, L
ist`1 ServerTargetPlatforms, Dictionary`2 ServerDependentPlatformMap, Nullable`1 Build, Nullable`1 Cook, Nullable`1 Run, Nullable`1 SkipServer, Nullable`1 Clean, Nullable`1 Compressed, Nullable`1 UseDebugParamForEditorExe, Nullable`1 IterativeCooking, Nullable`1 IterateSharedCookedBuild, Nullable`1 CookAll, Nullable`1 CookPartialGC, Nullable`1 CookInEditor, 
String CookOutputDir, Nullable`1 CookMapsOnly, Nullable`1 CookOnTheFly, Nullable`1 CookOnTheFlyStreaming, Nullable`1 UnversionedCookedContent, Nullable`1 EncryptIniFiles, Nullable`1 EncryptPakIndex, Nullable`1 EncryptEverything, Nullable`1 SkipCookingEditorContent, Nullable`1 NumCookersToSpawn, String AdditionalCookerOptions, String BasedOnReleaseVersion, St
ring CreateReleaseVersion, String CreateReleaseVersionBasePath, String BasedOnReleaseVersionBasePath, Nullable`1 GeneratePatch, String DLCName, String DiffCookedContentPath, Nullable`1 DLCIncludeEngineContent, Nullable`1 CrashReporter, Nullable`1 DedicatedServer, Nullable`1 Client, Nullable`1 Deploy, String DeployFolder, Nullable`1 FileServer, Nullable`1 For
eign, Nullable`1 ForeignCode, Nullable`1 LogWindow, Nullable`1 NoCleanStage, Nullable`1 NoClient, Nullable`1 NoDebugInfo, Nullable`1 NoXGE, Nullable`1 Package, Nullable`1 Pak, Nullable`1 Prereqs, String AppLocalDirectory, Nullable`1 NoBootstrapExe, Nullable`1 SignedPak, Nullable`1 NullRHI, Nullable`1 FakeClient, Nullable`1 EditorTest, Nullable`1 RunAutomatio
nTests, String RunAutomationTest, Nullable`1 CrashIndex, Nullable`1 SkipCook, Nullable`1 SkipCookOnTheFly, Nullable`1 SkipPak, Nullable`1 SkipStage, Nullable`1 Stage, Nullable`1 Manifests, Nullable`1 CreateChunkInstall, Nullable`1 Unattended, Nullable`1 NumClients, Nullable`1 Archive, String ArchiveDirectoryParam, Nullable`1 ArchiveMetaData, Nullable`1 Creat
eAppBundle, ParamList`1 ProgramTargets, Nullable`1 Distribution, Nullable`1 Prebuilt, Nullable`1 RunTimeoutSeconds, String SpecifiedArchitecture, Nullable`1 IterativeDeploy, Nullable`1 FastCook, Nullable`1 IgnoreCookErrors, Nullable`1 RunAssetNativization, Nullable`1 CodeSign, Nullable`1 TreatNonShippingBinariesAsDebugFiles, String Provision, String Certific
ate, String Team, Boolean AutomaticSigning, ParamList`1 InMapsToRebuildLightMaps, ParamList`1 TitleID) in C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\AutomationUtils\ProjectParams.cs:Zeile 888.
UATHelper: Packaging (Windows (64-bit)):    bei BuildCookRun.SetupParams() in C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:Zeile 51.
UATHelper: Packaging (Windows (64-bit)):    bei BuildCookRun.ExecuteBuild() in C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:Zeile 38.
UATHelper: Packaging (Windows (64-bit)):    bei AutomationTool.BuildCommand.Execute() in C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\AutomationUtils\BuildCommand.cs:Zeile 100.
UATHelper: Packaging (Windows (64-bit)):    bei AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands) in C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:Zeile 566.
UATHelper: Packaging (Windows (64-bit)):    bei AutomationTool.Automation.Process(String[] Arguments) in C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:Zeile 536.
UATHelper: Packaging (Windows (64-bit)):    bei AutomationTool.Program.MainProc(Object Param) in C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Program.cs:Zeile 133.
UATHelper: Packaging (Windows (64-bit)):    bei AutomationTool.InternalUtils.RunSingleInstance(Func`2 Main, Object Param) in C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:Zeile 704.
UATHelper: Packaging (Windows (64-bit)):    bei AutomationTool.Program.Main() in C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Program.cs:Zeile 57.
UATHelper: Packaging (Windows (64-bit)): Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Windows (64-bit)): BUILD FAILED

Does anyone know what the problem could be?

I hope we get some answers for this. There is atleast two other threads I belive about same problem in 24 hours.

oh ok… good to know that I am not the only one.

Hello,

The error message you’re referring to (Error Unknown Error and/or Automation Tool exiting with ExitCode = 1) is a generic error message that means that the actual error message that describes the problem is elsewhere in the log. Please refer to the Packaging and Deployment Troubleshooting guide for more information on what you may be able to do to find the error in your log, fix your issue, what information you may need to provide for any further assistance.

Sounds like there could be multiple Unreal processes running. When one is making a change to these files, it can cause the file to be locked from being accessed. This can happen when canceling builds at times. I would suggest closing the editor and Epic Games Launcher, opening the Windows Task Manager and checking the Processes tab for any Unreal processes such as UnrealBuildTool. If they are there, end the process and attempt again.

This error has also been related to anti virus programs interfering in the past.

Edit: If none of that helps, as the guide I linked states, please provide the full log file for additional assistance.

Hey Matthew,

thank you for your answer.

So after examining the error log I can spot two different “real” errors.

The first one:

ERROR: AutomationTool terminated with exception: AutomationTool.AutomationException: Failed to build "C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Scripts\UAT.proj":

And the second one says something like:

error CS2012: "C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\BuildGraph\obj\Development\BuildGraph.Automation.dll" can not be opened to write: The process can not access the file "C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\
AutomationTool\BuildGraph\obj\Development\BuildGraph.Automation.dll" , because it is alredy in use by another process." [C:\UnrealEngine-release\UE416\UnrealEngine-release\Engine\Source\Programs\AutomationTool\BuildGraph\BuildGraph.Automation.csproj]

But I can’t really tell how to fix it by just using the error messages.

I got the same trouble at the project launcher.
So I detached VisualStudio and it worked correctly.

So I deinstalled my Antivirus programm and rebuild the engine from source. After fixing some other log errors it works.

So it was either the Antivirus program or me installing the engine wrong.

Thanks again for your help.

i don’t understand error it! Please help me!