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

Someone on StackOverflow had the solution for this. The ProjectNameSample.cs needs to be coped to a new ProjectName.Target.cs file, and the interior class name also changed to reflect the file name (if copying the file stated, it should already have “Target” in the class name and not need to be renamed).

350573-unreal-targetnotfound-packaging-01.png

350572-unreal-targetnotfound-packaging-02.png