# MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: AutomationTool terminated with exception: System.ArgumentException: An item with the same key has already been added

**URL:** <https://forums.unrealengine.com/t/mainframeactions-packaging-windows-64-bit-program-main-error-automationtool-terminated-with-exception-system-argumentexception-an-item-with-the-same-key-has-already-been-added/375500>\
**Category:** Platform & Builds\
**Tags:** object-picker, runuatbat-error, tarray:-arrays-in-un, unreal-engine, UE4, question\
**Created:** [November 6, 2016, 6:53pm UTC](https://forums.unrealengine.com/t/mainframeactions-packaging-windows-64-bit-program-main-error-automationtool-terminated-with-exception-system-argumentexception-an-item-with-the-same-key-has-already-been-added/375500 "2016-11-06T18:53:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_fc71d6a0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fc71d6a0](https://forums.unrealengine.com/u/anonymous_user_fc71d6a0)\
**Post date:** [November 6, 2016, 6:53pm UTC](https://forums.unrealengine.com/t/mainframeactions-packaging-windows-64-bit-program-main-error-automationtool-terminated-with-exception-system-argumentexception-an-item-with-the-same-key-has-already-been-added/375500/1 "2016-11-06T18:53:20Z")

</div>

I’m facing packag problem…after i migrate two project into a project…  
Can someone help me…

LogSavePackage: Save=6707.67ms  
LogSavePackage: Moving ‘F:/project/2016/1608\_OCR Property (OCR)/unreal engine ocr/HANI/BINBIN021116/OCR\_lobby\_PODIUM BINEDITING - 25102016/Saved/UEDPCSKYDetchC3B3428C48AA082EA6D16993672F881A.tmp’ to ‘F:/project/2016/1608\_OCR Property (OCR)/unreal engine ocr/HANI/BINBIN021116/OCR\_lobby\_PODIUM BINEDITING - 25102016/Saved/Autosaves/Game/UEDPCSKYDetch.umap’  
LogSavePackage:Display: Finished SavePackage F:/project/2016/1608\_OCR Property (OCR)/unreal engine ocr/HANI/BINBIN021116/OCR\_lobby\_PODIUM BINEDITING - 25102016/Saved/Autosaves/Game/UEDPCSKYDetch.umap  
LogEditorTransaction: Undo Spawn Play From Here Start  
MainFrameActions: Packaging (Windows (64-bit)): Running AutomationTool…  
MainFrameActions: Packaging (Windows (64-bit)): Automation.ParseCommandLine: Parsing command line: -ScriptsForProject=F:/project/2016/1608\_OCR Property (OCR)/unreal engine ocr/HANI/BINBIN021116/OCR\_lobby\_PODIUM BINEDITING - 25102016/ocr\_lobby\_skydeck.uproject BuildCookRun -nocompile -nocompileeditor -installed -nop4 -project=F:/project/2016/1608\_OCR Property  
(OCR)/unreal engine ocr/HANI/BINBIN021116/OCR\_lobby\_PODIUM BINEDITING - 25102016/ocr\_lobby\_skydeck.uproject -cook -stage -archive -archivedirectory=F:/project/2016/1608\_OCR Property (OCR)/unreal engine ocr/HANI/pano -package -clientconfig=Development -ue4exe=UE4Editor-Cmd.exe -pak -prereqs -nodebuginfo -targetplatform=Win64 -build -CrashReporter -utf8output  
MainFrameActions: Packaging (Windows (64-bit)): Automation.Process: Setting up command environment.  
MainFrameActions: Packaging (Windows (64-bit)): BuildCookRun.SetupParams: Setting up ProjectParams for F:\project\2016\1608\_OCR Property (OCR)\unreal engine ocr\HANI\BINBIN021116\OCR\_lobby\_PODIUM BINEDITING - 25102016\ocr\_lobby\_skydeck.uproject  
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: AutomationTool terminated with exception: System.ArgumentException: An item with the same key has already been added.  
MainFrameActions: Packaging (Windows (64-bit)): at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)  
MainFrameActions: Packaging (Windows (64-bit)): at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.ProjectUtils.CompileAndLoadTargetsAssembly(ProjectProperties Properties, FileReference TargetsDllFilename, Boolean DoNotCompile, List`1 TargetScripts)  
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.ProjectUtils.DetectTargetsForProject(ProjectProperties Properties, List`1 ExtraSearchPaths) MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.ProjectUtils.DetectProjectProperties(FileReference RawProjectPath, List`1 ClientTargetPlatforms, Boolean AssetNativizationRequested)  
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTo  
MainFrameActions: Packaging (Windows (64-bit)): ol.ProjectUtils.GetProjectProperties(FileReference RawProjectPath, List`1 ClientTargetPlatforms, Boolean AssetNativizationRequested) MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.ProjectParams.AutodetectSettings(Boolean bReset) MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.ProjectParams..ctor(FileReference RawProjectPath, CommandUtils Command, String Device, String MapToRun, String AdditionalServerMapParams, ParamList`1 Port, String RunCommandline, String StageCommandline, String BundleName, String StageDirectoryParam, String UE4Exe, String SignPak, List`1 Cl ientConfigsToBuild, List`1 ServerConfigsToBuild, ParamList`1 MapsToCook, ParamList`1 DirectoriesToCook, String InternationalizationPreset, ParamList`1 CulturesToCook, ParamList`1 ClientCookedTargets, ParamList`1 EditorTargets, ParamList`1 ServerCookedTargets, List`1 ClientTargetPlatforms, Dictionary`2 ClientDependentPlatformMap, List`1 ServerTargetPlatforms, Dictionary`2 ServerDependentPlatformMap, Nullable`1 Build, Nullable`1 Cook, String CookFlavor, Nullable`1 Run, Nullable`1 SkipServer, Nullable`1 Clean, Nullable`1 Compressed, Nullable`1 UseDebugParamForEditorExe, Nullable`1 IterativeCooking, Nullable`1 CookAll, Nullable`1 CookMapsOnly, Nullable`1 CookOnTheFly, Nullable`1 CookOnTheFlyStreaming, Nullable`1 Un versionedCookedContent, Nullable`1 SkipCookingEditorContent, Nullable`1 NumCookersToSpawn, String AdditionalCookerOptions, String BasedOnReleaseVersion, String CreateReleaseVersion, String CreateReleaseVersionBasePath, String BasedOnReleaseVersionBasePath, Nullable`1 GeneratePatch, String DLCName, String DiffCookedContentPath, Nullable`1 DLCIncludeEngineCont ent, Nullable`1 NewCook, Nullable`1 OldCook, Nullable`1 CrashReporter, Nullable`1 DedicatedServer, Nullable`1 Client, Nullable`1 Deploy, Nullable`1 FileServer, Nullable`1 Foreign, 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, Nullable`1 NoBootstrapExe, Nullable`1 SignedPak, Nullable`1 NullRHI, Nullable`1 FakeClient, Nullable`1 EditorTest, Nullable`1 RunAutomationTests, 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 CreateChunkI  
nstall, Nullable`1 Unattended, Nullable`1 NumClients, Nullable`1 Archive, String ArchiveDirectoryParam, Nullable`1 ArchiveMetaData, Nullable`1 CreateAppBundle, ParamList`1 ProgramTargets, Nullable`1 Distribution, Nullable`1 Prebuilt, Nullable`1 RunTimeoutSeconds, String SpecifiedArchitecture, Nullable`1 IterativeDeploy, Nullable`1 FastCook, Nullable`1 Ignore  
CookErrors, Nullable`1 RunAssetNativization, Nullable`1 CodeSign, Nullable`1 TreatNonShippingBinariesAsDebugFiles, Nullable`1 UploadSymbols, String Provision, String Certificate, ParamList`1 InMapsToRebuildLightMaps, ParamList`1 TitleID)  
MainFrameActions: Packaging (Windows (64-bit)): at BuildCookRun.SetupParams()  
MainFrameActions: Packaging (Windows (64-bit)): at BuildCookRun.ExecuteBuild()  
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.BuildCommand.Execute()  
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands)  
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Automation.Process(String[] CommandLine)  
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Program.MainProc(Object Param)  
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.InternalUtils.RunSingleInstance(Func`2 Main, Object Param)  
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.Program.Main()  
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: AutomationTool exiting with ExitCode=1 (Error\_Unknown)  
MainFrameActions: Packaging (Windows (64-bit)): Domain\_ProcessExit  
MainFrameActions: Packaging (Windows (64-bit)): copying UAT log files…  
MainFrameActions: Packaging (Windows (64-bit)): BUILD FAILED  
PackagingResults:Error: Error Unknown Error

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [November 7, 2016, 8:15pm UTC](https://forums.unrealengine.com/t/mainframeactions-packaging-windows-64-bit-program-main-error-automationtool-terminated-with-exception-system-argumentexception-an-item-with-the-same-key-has-already-been-added/375500/2 "2016-11-07T20:15:53Z")

</div>

Hey Jun Bin,

Here are a few Answerhub threads where users have experienced this issue that you can use for reference as far as how to resolve your issue:

> **[Program.Main: ERROR: An item with the same key has already been added](https://forums.unrealengine.com/questions/272095/programmain-error-an-item-with-the-same-key-has-al.html)**
>
> Hello , I am quite new to the world of Game engines and Coding. I am an artist and using Blueprint I was trying to get an arch viz project done with just some assets and the 1st Person shooter BP. As the project was evolving I kept packaging and...

> **[Can't package game (an item with the same key has already been added)](https://forums.unrealengine.com/questions/284296/cant-package-game-an-item-with-the-same-key-has-al.html)**
>
> I recently switched from 4.8.3 binary to a custom build of the engine (https://github.com/Oculus-VR/UnrealEngine/tree/4.8). This is what I did: Built the engine (configuration 'Development Editor') Converted my project (runs fine in editor)...

> **[Unable to Package C++ Project for Win32/Win64](https://forums.unrealengine.com/questions/98621/error-an-item-with-the-same-key-has-already-been-a.html)**
>
> Hello, I am setting up a new UE4 project (with code), and as a simple test I tried to build a Win64 package of a new “Code Third Person” project. I haven’t made any code/content changes yet, just trying to package. I am building the editor from...

If you do not find your answer in one of those threads, you can also google your error message to get more results.

Finally, if you resolve your error and still experience a packaging failure, please provide me with the full output log.

Have a great day

---

<div class="post-metadata">

**Author:** ![Joshianian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joshianian](https://forums.unrealengine.com/u/Joshianian)\
**Post date:** [July 8, 2021, 3:26am UTC](https://forums.unrealengine.com/t/mainframeactions-packaging-windows-64-bit-program-main-error-automationtool-terminated-with-exception-system-argumentexception-an-item-with-the-same-key-has-already-been-added/375500/3 "2021-07-08T03:26:55Z")

</div>

hi Sean, none of the solutions above worked for me. Still having the issue and getting an output log as,

`An item with the same key has already been added`  
and  
`Unknown Error`

at the same time. is there any other solution please? thanks

---

<div class="post-metadata">

**Author:** ![stepharamburu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@stepharamburu](https://forums.unrealengine.com/u/stepharamburu)\
**Post date:** [February 23, 2022, 3:08pm UTC](https://forums.unrealengine.com/t/mainframeactions-packaging-windows-64-bit-program-main-error-automationtool-terminated-with-exception-system-argumentexception-an-item-with-the-same-key-has-already-been-added/375500/4 "2022-02-23T15:08:31Z")

</div>

Hi @Joshianian, Did you find a solution? I’ve got the same problem even with a clean new blank template.

---

<div class="post-metadata">

**Author:** ![MajorT](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/majort/32/1219796_2.png) [@MajorT](https://forums.unrealengine.com/u/MajorT)\
**Post date:** [February 23, 2022, 3:17pm UTC](https://forums.unrealengine.com/t/mainframeactions-packaging-windows-64-bit-program-main-error-automationtool-terminated-with-exception-system-argumentexception-an-item-with-the-same-key-has-already-been-added/375500/5 "2022-02-23T15:17:27Z")

</div>

I had the same error. I made a mistake with a plugin. I added a plugin in the directory of my project ("[MyProjectName]/plugins/[MyPlugin]").  
And I hade the same plugin twice. So I deleted one and than it worked for me  
Maybe you should check that.  
But Idk.
