UE5 C ++ Packaged Projects Not Playable

I’ve recently upgraded from UE4.27 to UE5, but I’m stumbling out of the gate as far as packaging a project goes. I’m able to create a default Third Person Blueprint project and package it for Windows, and when I open the packaged .exe file, it plays just fine. But when I do the exact same thing with a default Third Person C++ project, it packages, but then when I try to open the .exe file, all I get is a black screen. After a few seconds, I get an error message that the program has stopped running.

I’m completely stumped on this one. It’s a default project. I have changed literally nothing on it, and it won’t package. Has anyone else been having this problem with C++ projects in UE5? Any ideas what could be causing this? I’ve been working on a C++ UE4 project for a year now and would like to switch it over to UE5, but if I can’t get anything packaged and working there, that’s obviously a deal breaker!

Any help would be appreciated.

2 Likes

I’ve just created a third person C++ project, I can confirm the same black screen and this error
image

Here are the details of my crash if anyone is interested, default settings.

Summary

Assertion failed: Index != INDEX_NONE [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Public\Animation\AttributeTypes.h] [Line: 117]
Missing operator for attribute, type IntegerAnimationAttribute was not registered previously

0x00007ff620321ace MyProject.exe!UE::Anim::AttributeTypes::GetTypeOperator() []
0x00007ff620333380 MyProject.exe!FAttributeCurve::Serialize() []
0x00007ff61c0abb1d MyProject.exe!UScriptStruct::SerializeItem() []
0x00007ff61c220b06 MyProject.exe!FStructProperty::SerializeItem() []
0x00007ff61c21e6af MyProject.exe!FMapProperty::SerializeItem() []
0x00007ff61c0ac548 MyProject.exe!SerializeUnversionedProperties() []
0x00007ff61c1ad172 MyProject.exe!UObject::SerializeScriptProperties() []
0x00007ff61c1acea1 MyProject.exe!UObject::Serialize() []
0x00007ff61c1acd10 MyProject.exe!UObject::Serialize() []
0x00007ff620382a3e MyProject.exe!UAnimationAsset::Serialize() []
0x00007ff62049b254 MyProject.exe!UAnimSequenceBase::Serialize() []
0x00007ff62045947b MyProject.exe!UAnimSequence::Serialize() []
0x00007ff61bfacd30 MyProject.exe!FAsyncPackage2::EventDrivenSerializeExport() []
0x00007ff61bfb40c0 MyProject.exe!FAsyncPackage2::Event_ProcessExportBundle() []
0x00007ff61bfb7cf3 MyProject.exe!FEventLoadNode2::Execute() []
0x00007ff61bfd19f6 MyProject.exe!FAsyncLoadEventQueue2::PopAndExecute() []
0x00007ff61bfd7eb3 MyProject.exe!FAsyncLoadingThread2::ProcessAsyncLoadingFromGameThread() []
0x00007ff61bffc814 MyProject.exe!FAsyncLoadingThread2::TickAsyncThreadFromGameThread() []
0x00007ff61bffad7b MyProject.exe!FAsyncLoadingThread2::TickAsyncLoadingFromGameThread() []
0x00007ff61bfc0584 MyProject.exe!FAsyncLoadingThread2::FlushLoading() []
0x00007ff61c01ccdf MyProject.exe!FlushAsyncLoading() []
0x00007ff61c2b3b59 MyProject.exe!LoadPackageInternal() []
0x00007ff61c2b3624 MyProject.exe!LoadPackage() []
0x00007ff61c2c9ff8 MyProject.exe!ResolveName() []
0x00007ff61c2d5aa0 MyProject.exe!StaticLoadObjectInternal() []
0x00007ff61c2d4fa2 MyProject.exe!StaticLoadObject() []
0x00007ff61c2d4920 MyProject.exe!StaticLoadClass() []
0x00007ff61b83e129 MyProject.exe!ConstructorHelpersInternal::FindOrLoadClass() [E:_Unreal\Engine\UE_5.0\Engine\Source\Runtime\CoreUObject\Public\UObject\ConstructorHelpers.h:87]
0x00007ff61b83dc9e MyProject.exe!AMyProjectGameMode::AMyProjectGameMode() [E:\UnrealProjects\MyProject\Source\MyProject\MyProjectGameMode.cpp:10]
0x00007ff61c0556d3 MyProject.exe!UClass::CreateDefaultObject() []
0x00007ff61c2d9902 MyProject.exe!UObjectInitialized() []
0x00007ff61c2baa4a MyProject.exe!ProcessNewlyLoadedUObjects() []
0x00007ff61a4c76ca MyProject.exe!FEngineLoop::PreInitPostStartupScreen() []
0x00007ff61a4c0b9c MyProject.exe!GuardedMain() []
0x00007ff61a4c0eda MyProject.exe!GuardedMainWrapper() []
0x00007ff61a4c3f5c MyProject.exe!LaunchWindowsStartup() []
0x00007ff61a4d5704 MyProject.exe!WinMain() []
0x00007ff62253a26a MyProject.exe!__scrt_common_main_seh() [d:\a01_work\12\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
0x00007ffa89217034 KERNEL32.DLL!UnknownFunction []
0x00007ffa8a462651 ntdll.dll!UnknownFunction []

When I got the notification that UE5 was full release, like you I tried to install it, get it working, make a simple template project, and build [crashes UE5] and so workaround Package a Win project, which has an identical error for the same thing, on the same line as yours.

I think someone accidentally made a typo/hard coded reference to something that is meant to be a variable path, going to have to wait till they fix it and update UE5 core files, as it happens on 3rdP or TopD, probably anything at the moment

ue5cantpackageatm

Yeah, it appears to be something template-specific. I tried packaging a First Person C++ project and it worked just fine. I then tried the Third Person Blueprint template again, but this time added some custom C++ classes. It packaged and played without issue. So it seems to only be certain C++ templates that are not working. Maybe something screwy in how they coded the example Character, I guess? In the meantime, I guess the workaround is to start with a Blueprint project and then add C++ classes to it.

I’m wondering, has anyone been able to successfully play a packaged UE5 Third Person or Top-Down C++ project?

So, I found the offending lines of code. Inside the example GameMode.cpp file, starting at line 10, there’s this little nugget:

[static ConstructorHelpers::FClassFinder PlayerPawnBPClass(TEXT("/Game/ThirdPerson/Blueprints/BP_ThirdPersonCharacter"));
if (PlayerPawnBPClass.Class != NULL)
{
DefaultPawnClass = PlayerPawnBPClass.Class;
}]

I can’t exactly pinpoint why this is crashing the game, though it’s just sketchy overall. I don’t see why it’s a good idea to hard reference the character’s folder location, and I can envision how this could end up trying to read from an empty reference. So, I commented this section out and used my own custom Game Mode instead. After that, the default C++ Third Person template packaged and played flawlessly. So, until (and if) Epic fixes this, that appears to be one simple way of getting your game to work if you’re experiencing this problem.

**sorry about deleting the previous post; I’m still learning how to use the forum!

3 Likes

You can just use the edit button (the pencil), you don’t need to delete the post and rewrite it!
If you need a guide on how to use the Forum @discobot has two nice interactive tutorials that explain every functionality, just send “him” a message

By the way, thank you for pointing out the error!

Hi! To find out what I can do, say @discobot display help.

1 Like

Oh cool, thanks! I will definitely need to spend some time with @discobot !

I’m not entirely happy with that hacky fix, to be honest. Looking back at my older UE4 projects, they have the exact same line of code in their Game Mode .cpp files (though the file path is slightly different), yet they work just fine. So, while getting rid of it does get the game working, I don’t understand why it’s necessary to do that… which makes me think there’s some other issue lurking out there, maybe in how things are being constructed? Not sure. But this works for now, at least!

99% certain it’s a typo in the Source Code of UE5, I’ve been trying for a week or so with this typo now, I didn’t think to replace the GameMode.

I was going to replace the GameInstance, guess I should replace GameMode too instead of waiting for a response to the BugReport.

It looks like someone tried to do a string concatenation, but left it inside the " " [build++UE5] so it didn’t resolve, but it’s still weird it hard reference points to D:\ that is certainly not a valid call, so it’s either hard referenced there, or inside the Global definitions of Path/GetPath responses.

I don’t want to think someone made a Global definition of Path/GetPath, but it’s possible, guess we need to get onto the UE Discord and ask if anyone did some sleuthing into the Public GitHUB for UE5 to find the error on line 117

1 Like