Program.Main: ERROR: An item with the same key has already been added

Not sure what it might be worth today, three years later, but hopefully it can assist somebody else. But what I did to fix mine was that I had to turn off encryption. Obviously it’s not the desirable fix but if you’re just looking to currently package the project at all for development testing purposes, I turned mine off and that worked.

Thank you !

I was having the same problem as well. I tried looking into the *.target extension but I wasn’t sure what to delete.

Instead, I made a new blank project and migrate the root folder into the new project, loaded the input settings, change the game mode to MyGameMode and was able to have to fix the problem this way. This could possibly be an alternative if you do not want to delete any .target files from your system like me.

I was having the same problem as well. I tried looking into the *.target extension but I wasn’t sure what to delete.

Instead, I made a new blank project and migrate the root folder into the new project, loaded the input settings, change the game mode to MyGameMode and was able to have to fix the problem this way. This could possibly be an alternative if you do not want to delete any .target files from your system like me.

Wow, it works.!! thank you.

Hey all, just another solution to this issue. Neither of the above solutions worked for me but i found my issue. I ended up renaming my project and that caused multiple “.Build.cs” “.Targets.cs” and “.cpp” files. For those who don’t know, just in case, they are located in your unreal project file. Navigate to Intermediate → Source. Inside that file you will see them. All I did was cut and paste the old ones, with the previous project name, outside the file structure on my desktop and it worked fine. no more issues.

Thanks very much Sam Drangsland. That is the one that got me shifting. Shame the error logs don’t see fit to name the suspects that they don’t like.
cheers anyway.

I was having the same issue after renaming a blueprint-only project.
All I had to do was to go and delete the Intermediate folder in my project, and then package again.

I encountered this issue as well. The problem was that I accidentally had the same plugin installed in the project as well as in the engine.

Aha! That’s what it was for me, too. Maybe that wasn’t a problem in previous versions, but it is now and deleting the plugin from the engine folder, leaving just one copy in the project folder, worked! Thank you.

1 Like

Thank you so much! Been dealing with this error for over a week, trying everything I could think of but didn’t occur to me that it was something as simple as this. Fixed it immediately

Awesome thank you for this, this worked for me <3

Thanks!! The problem was plugin installed in the project as well as in the engine

I had this problem in 4.26 when I tried to package, because of a duplicate plugin that i had in the engine and in my project folder.

2 Likes

could you solve the problem? how did you detect the duplicate plugins? So far I could not find duplicates

This also happened to me when sharing a plugin with my team

Yeah I had to uninstall and reinstall the version i was using and then it would finally package. Kinda annoying Unreal hasnt answered anyone and we all have this issue! but thats why we have each other I guess!

I fixed this error after disabling git plugin that was not compatible with specific UE version. I installed it and forgot, obviously engine doesn’t like it and refused to build.

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.

Try packing with option Development and I deleted the build file in the project file and it was fixed.