Packaging failed. Unable to compile source files

You should use master for latest version or version dedicated for your engine version. I see you are using 4.21 and that’s the only one that doesn’t exists. I would go about 4.22 or upgrade project.

Your error is in project code is this log from (see C:\Users\Bruce\AppData\Roaming\Unreal Engine\AutomationTool\Logs\F+UE_4.21\Log.txt for full exception trace)?