Create new project (I used the c++ vehicle template)
Open [ProjectName]Pawn.cpp and add the following line to create a static variable (don’t add it inside a function)
TArray< TEnumAsByte< EObjectTypeQuery > > ObjectTypes{ UEngineTypes::ConvertToObjectType(ECollisionChannel::ECC_Vehicle) };
It took me 3 days to track the issue down to that one line, it happens in both UE 5.3.2 and UE 5.4.2.
I hope this saves some time for other developers.
Does anyone have any idea why would that line cause the packaged project to not open ? It would not even generate Saved\Logs.
Then you can pack without the extra set of the init function.
I can only guess that UEngineTypes::ConvertToObjectType(ECollisionChannel::ECC_Vehicle) either is either stripped out in the packed version or maybe the static array is filled at a time where the UEngineTypes::ConvertToObjectType is calling some part of the engine that isn’t loaded yet.