Unable to Package C++ Project for Win32/Win64

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 full source, version 4.3.1.

Full log attached

Any ideas?

Thanks in advance,

Dave


Exact Repro steps:

  1. Copy/Branch 4.3.1 engine code to a new project folder
  2. Generate solution files and build Win64 Development Editor
  3. Launch Editor and Create a “Code Third Person” project in the same folder you branched to
  4. Build Development Editor for the new project
  5. Launch Editor, attempt to package for Win64

AutomationTool is crashing which is one of build tools, nothing related to game or engine code

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

You might try to rebuild it if you have UE4 source, or there something unexpected (for AutomationTool) in your system, it would mean it’s a bug

Assuming you would want to use the engine built from source instead of the downloaded editor.
Try this:

  1. Separate your engine source code and project folder.
  2. Build engine, then go into Engine/Binaries/Win64 and run UnrealVersionSelector-Win64-Shipping.exe
  3. Go to your project folder, right click on .uproject and click Switch Unreal Engine version, select Source build
  4. Now generate VS project files and proceed with packaging.
1 Like

I have tried cleaning/rebuilding the AutomationTool project, to no avail… This should be on a fresh copy of the UE4 source code (I check the engine source into its own branch and then merge a copy for each project before monkeying with it in any way to ease version upgrades). This test was on a fresh merge + rebuild of everything (automation tool included I believe) with absolutely nothing done in between the initial editor build and the package step. Trying to eliminate as many variables as possible…

I tried briefly to debug the tool with the command line indicated in the logs (launching the tool from VS and adding the command line from the logs to the project’s debug properties), but it just spawns in a new process. I tried briefly to attach the debugger while it ran with little luck - I will investigate more on that route…

Based on the logs, it looks like it makes a copy of the AutomationTool into the Windows AppData folder and runs it from there. It makes me wonder if there is some old garbage from a previous version of the engine kicking around causing problems, but I don’t really know a good way to ensure those folders are cleaned up.

One hint - the line numbers in the call stack in the attached log look like they don’t match up correctly to the code I have. It could be an optimization thing maybe…or perhaps evidence that the wrong version of the AutomationTool is being called.

The repro steps are pretty simple, so it seems like it must be something local to my machine causing the bug to manifest, just not sure the best way to track down what that is.

Thanks for the help,

Dave

That did it, thanks for the help :slight_smile: