Packaged game works on debug build, but crashes on startup when packaged in development or shipping

When packaged in shipping or development mode the .exe crashes before launching the game and just gives me “Fatal error” pop-up window. Only error I can find from log files is the same Fatal error info and access violation reading location error. Anyway to debug this?

Hi Piilorasva,

There are a few trouble shooting steps to follow initially when having packaging issues:

1. Delete The following folders and then try repackaging

  • Intermediate
  • Saved
  • Config (deleting this folder will result in having to re-enter all values for your Editor and Project Settings. So make a copy somewhere safe!)

2. Disable Plugins

NEXT
Please provide the Log file by clearing your Ouput Log, package your project, then Cut and Paste from the newly generated Output Log into a text document and post.

Thanks,

Ed Burgess

Hi, I found the problem. I have custom UBlueprintFunctionLibrary and a Class named Game inside that library. Inside this Game class I have a TMap structure that takes FString as a key and my own struct as a value. When I try to add key-value pairs to this TMap the game crashes. It even crashes if I only call the function to add data only in BeginPlay on an actor at different map than my starting map. This has worked before so I don’t think that anything dramatic has changed since.

More info. Previously I tried to add info to my TMap with using key like this = “Character name”. I changed this to = FString(TEXT(“Character name”)) and most of my problems went away, but still few lines caused a crash. I tried a crashing line with = TEXT(“Character name”) and it no longer crashed but then previously working lines started crashing…
The crash takes me to line 146 in GenericPlatformString.h

If you are able to reproduce a crash consistently and have found the cause could you create a new AnswerHub post under the bug reports section stating the problem and steps to reproduce in a clean project.

You should only include instructions on how to recreate the specific assets that cause the crash. This will be especially important to us if your setup worked in 4.12 but is now crashing in 4.13.

Thank you,

Ed Burgess

I tried to reproduce the problem in fresh project but didn’t succeed. But I found a workaround to get my TMap addition working. Struct constructor that I was using as value in my TMap looked liked this:

FCharacterInfo(FString pfirstname, FString psurname, int32 page, ECharacterAccessLevel paccesslevel, ECharacterStatus status, bool hasBeenPlayed,ECharacterGender pgender, ECharacterStrength pstrength, FString pProfession)
		{
			firstName = pfirstname;
			surName = psurname;
			age = page;
			accessLevel = paccesslevel;
			characterStatus = status;
			hasCharacterBeenPlayed = hasBeenPlayed;
			gender = pgender;
			strength = pstrength;
			profession = pProfession;
		}

The random problem causer was the part where I assign pProfession parameter to my profession variable. I simply switched profession to be FText instead of FString and convert the FString parameter to FText.

Okay, I’m glad you found a workaround. That does sound odd though. I will keep an eye out if any other users are having issues with string parameters in their structs when packaging.