"ERROR: Unable to find target 'UE4Game'" - Packaging fails

This didn’t work for me. I’m using UE version 4.26.2. I have recently deleted all obsolete engine versions and obsolete projects, so perhaps that has something to do with my error?

I am in the process of migrating all of the folders from content into a new, empty project without starter content. This is a viable option early on, but if this error comes back late in development, it could be a big issue.

Some additional things I had to do include:

  1. Select my default game mode from “Project Settings > Maps & Modes”.
  2. Setup a default startup map for editor & Game mode in “Project Settings > Maps & Modes”
  3. Recreate Custom Collision “Object Channels” from “Project Settings > Collision”
  4. Re-add my custom Software Cursor from “Project Settings > Engine > User Interface”

I will report back if packaging is successful or not.