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

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.Dictionary2.Insert(TKey key, TValue value, Boolean add) MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.ProjectUtils.CompileAndLoadTargetsAssembly(ProjectProperties Properties, FileReference TargetsDllFilename, Boolean DoNotCompile, List1 TargetScripts)
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.ProjectUtils.DetectTargetsForProject(ProjectProperties Properties, List1 ExtraSearchPaths) MainFrameActions: Packaging (Windows (64-bit)): at AutomationTool.ProjectUtils.DetectProjectProperties(FileReference RawProjectPath, List1 ClientTargetPlatforms, Boolean AssetNativizationRequested)
MainFrameActions: Packaging (Windows (64-bit)): at AutomationTo
MainFrameActions: Packaging (Windows (64-bit)): ol.ProjectUtils.GetProjectProperties(FileReference RawProjectPath, List1 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, ParamList1 Port, String RunCommandline, String StageCommandline, String BundleName, String StageDirectoryParam, String UE4Exe, String SignPak, List1 Cl ientConfigsToBuild, List1 ServerConfigsToBuild, ParamList1 MapsToCook, ParamList1 DirectoriesToCook, String InternationalizationPreset, ParamList1 CulturesToCook, ParamList1 ClientCookedTargets, ParamList1 EditorTargets, ParamList1 ServerCookedTargets, List1 ClientTargetPlatforms, Dictionary2 ClientDependentPlatformMap, List1 ServerTargetPlatforms, Dictionary2 ServerDependentPlatformMap, Nullable1 Build, Nullable1 Cook, String CookFlavor, Nullable1 Run, Nullable1 SkipServer, Nullable1 Clean, Nullable1 Compressed, Nullable1 UseDebugParamForEditorExe, Nullable1 IterativeCooking, Nullable1 CookAll, Nullable1 CookMapsOnly, Nullable1 CookOnTheFly, Nullable1 CookOnTheFlyStreaming, Nullable1 Un versionedCookedContent, Nullable1 SkipCookingEditorContent, Nullable1 NumCookersToSpawn, String AdditionalCookerOptions, String BasedOnReleaseVersion, String CreateReleaseVersion, String CreateReleaseVersionBasePath, String BasedOnReleaseVersionBasePath, Nullable1 GeneratePatch, String DLCName, String DiffCookedContentPath, Nullable1 DLCIncludeEngineCont ent, Nullable1 NewCook, Nullable1 OldCook, Nullable1 CrashReporter, Nullable1 DedicatedServer, Nullable1 Client, Nullable1 Deploy, Nullable1 FileServer, Nullable1 Foreign, Nullable1 ForeignCode, Nullable1 LogWindow, Nullable1 NoCleanStage, Nullable1 NoClient, Nullable1 NoDebugInfo, Nullable1 NoXGE, Nullable1 Package, Nullable1 Pak, Nullable1
Prereqs, Nullable1 NoBootstrapExe, Nullable1 SignedPak, Nullable1 NullRHI, Nullable1 FakeClient, Nullable1 EditorTest, Nullable1 RunAutomationTests, String RunAutomationTest, Nullable1 CrashIndex, Nullable1 SkipCook, Nullable1 SkipCookOnTheFly, Nullable1 SkipPak, Nullable1 SkipStage, Nullable1 Stage, Nullable1 Manifests, Nullable1 CreateChunkI
nstall, Nullable1 Unattended, Nullable1 NumClients, Nullable1 Archive, String ArchiveDirectoryParam, Nullable1 ArchiveMetaData, Nullable1 CreateAppBundle, ParamList1 ProgramTargets, Nullable1 Distribution, Nullable1 Prebuilt, Nullable1 RunTimeoutSeconds, String SpecifiedArchitecture, Nullable1 IterativeDeploy, Nullable1 FastCook, Nullable1 Ignore
CookErrors, Nullable1 RunAssetNativization, Nullable1 CodeSign, Nullable1 TreatNonShippingBinariesAsDebugFiles, Nullable1 UploadSymbols, String Provision, String Certificate, ParamList1 InMapsToRebuildLightMaps, ParamList1 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(List1 CommandsToExecute, CaselessDictionary1 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

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:

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

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

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

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.