System.ArgumentException: An item with the same key has already been added

I cloned a previous project and worked about 50 hours on it.
Now that everything is completed, I can’t build it.

The error keeps coming up “An item with the same key has already been added”

I’ve searched for duplicate files in the project folder. And went through my assets to make sure they’re not named the same.

Did a build of other projects and they all build fine. so it’s definitely this specific project.

I don’t know what else to do. [link text][1]

106734-log.txt (6.06 KB)

1 Like

Talismansa,

Please try the following suggestions to resolve the issue you’re running in to:

Delete your Intermediate and Saved folders from your project. Reopen the project and try to package. If you run into the issue again, please look into the following resolved AnswerHub posts:

  • [AnswerHub: An item with the same key][1]
  • [AnswerHub: Error: An item with the same key has already been added][2]

Please let me know if none of the suggestions work for you, thanks!

Can't package game (an item with the same key has already been added) - Programming & Scripting - Epic Developer Community Forums
[2]: Unable to Package C++ Project for Win32/Win64 - Platform & Builds - Epic Developer Community Forums

Hi , I did try all the options in the other posts but none worked for me.

So I migrated everything to a new project and it worked.
It looks like it’s a cloning issue. I guess I just have to set up all the project settings every time.

Hi , I did try all the options in the other posts but none worked for me.

So I migrated everything to a new project and it worked.
It looks like it’s a cloning issue. I guess I just have to set up all the project settings every time.

I’m glad that you were able to get the issue to go away by moving your project to a new project. Perhaps if you run into this again, try deleting the Intermediate, Saved & Config folders and see if that wipes the project settings enough to fix the issue. Granted, you would have to set your configuration back up, but it’s just a thought.

Let me know if you find great reproduction steps, thanks!

Same here… had to migrate my project to a new one…
I think the error came because I moved the project 1 folder up inside the content folder

thank you ,i solved my problem.

as you say ,i delete the saved and intermediate folders ,then the package passed ,and show the really problem where is it .when delete it ,everything was fine .

It’s easy to solve this problem! Just go to the project folder and search for .target and pay for the oldest one!

What did you mean by paying for the oldest one?

Thank you , deleting the saved and intermediate folders did resolve my issue. :slight_smile:

hello none of these worked for me? and i tried on a brand new project still happens anyone know why?/

Make sure you havnt doubled up on Pluggins this is an issue i had. had two different versions of the same plugin

3 Likes

Thank you for this response. I had installed a Plugin at the engine level and then added the folder to the Plugins folder of my project. Deleting one or the other fixed the problem.

2 Likes

My Issue in this case was that I had a project plugin and an engine plugin of the same type/name. So I zipped my engine plugin and re-ran the packaging and it worked. That’s what the duplicate was.

4 Likes

Yeah! Same problem here and erasing the duplicated project plugins fix my problem.

3 Likes

I deleted the file in :\Program Files\Epic Games\UE_5.1\Engine\Plugins\Marketplace
folder “TwinmotiontoUnrealBeta” and left only TwinmotiontoUnreal.
and everything worked

1 Like

thanks!!! the easiest way to fix the problem!!!

Just delete the plugins folder in your project and you are good to go.

I just want to mention this because it fixed the problem for me. I was using a marketplace plugin, but because I wanted to make changes to the plugin, I had copied it into my project’s “Plugins” folder, and thus when building it saw that there were two copies of the plugin - One in the Unreal Engine Plugins folder, and one in my Project hence the “Item with the same key” error. Removing the plugin from the engine folder while packaging fixed the issue.
Thanks to TheoT for the solution.