AsyncLoading error : Nativized package crashes on attempt to process an asset before it has been added

Summary: It seems nativization in 4.16 breaks the asyncloader in our project. Assets are not loading properly and causing a variety of issues described below.

Note1: The project loads and works fine when packaged without nativization.
Note2: The project works fine when nativization is enabled in 4.15.

Issue Description:
Nativized package crashes on 4.16 Preview 3, very early in the loading process after about 1 second or it will load but break the game in different parts.

Blueprint Nativization Method: Exclusive
List of Blueprint assets to Nativize: With the list populated or with an empty list has the same result as long as nativization is enabled for packaging.


Here is one example of a Crash Report:

LowLevelFatalError [File:D:\Build\++UE4+Release-4.16+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 651] 
Attempt to process /Game/Gameplay/Objectives/Missions/MissionUnitWave/MissionUnitWave before it has been added.


> GalaxySample_Win64_Shipping!FDebug::AssertFailed() GalaxySample_Win64_Shipping!FEDLBootNotificationManager::NotifyRegistrationEvent()
> GalaxySample_Win64_Shipping!NotifyRegistrationEvent()
> GalaxySample_Win64_Shipping!GetStaticStruct()
> GalaxySample_Win64_Shipping!FMissionUnitWave__pf905351736::StaticStruct()
> GalaxySample_Win64_Shipping!ConstructDynamicType() GalaxySample_Win64_Shipping!FAsyncPackage::EventDrivenCreateExport()
> GalaxySample_Win64_Shipping!FAsyncPackage::ProcessImportsAndExports_Event()
> GalaxySample_Win64_Shipping!FAsyncPackage::Event_ProcessImportsAndExports()
> GalaxySample_Win64_Shipping!FObjectAndNameAsStringProxyArchive::operator<<()
> GalaxySample_Win64_Shipping!FAsyncLoadEventQueue::PopAndExecute()
> GalaxySample_Win64_Shipping!FAsyncLoadingThread::ProcessAsyncLoading()
> GalaxySample_Win64_Shipping!FAsyncLoadingThread::TickAsyncThread()
> GalaxySample_Win64_Shipping!FAsyncLoadingThread::TickAsyncLoading()
> GalaxySample_Win64_Shipping!FlushAsyncLoading()
> GalaxySample_Win64_Shipping!LoadPackageInternal()
> GalaxySample_Win64_Shipping!ResolveName()
> GalaxySample_Win64_Shipping!StaticLoadObjectInternal()
> GalaxySample_Win64_Shipping!StaticLoadObject()
> GalaxySample_Win64_Shipping!ConstructorHelpersInternal::FindOrLoadObject<UBehaviorTree>()
> [c:\program files\epic
> games\ue_4.16\engine\source\runtime\coreuobject\public\uobject\constructorhelpers.h:35]
> GalaxySample_Win64_Shipping!AH2_FactionAiController::AH2_FactionAiController()
> [c:\4.16\galaxysample\source\galaxysample\private\core\h2_factionaicontroller.cpp:13]
> GalaxySample_Win64_Shipping!UClass::CreateDefaultObject()
> GalaxySample_Win64_Shipping!UObjectForceRegistration()
> GalaxySample_Win64_Shipping!ProcessNewlyLoadedUObjects() GalaxySample_Win64_Shipping!FEngineLoop::PreInit() GalaxySample_Win64_Shipping!GuardedMain()
> GalaxySample_Win64_Shipping!GuardedMainWrapper()
> GalaxySample_Win64_Shipping!WinMain()
> GalaxySample_Win64_Shipping!__scrt_common_main_seh()
> [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
> kernel32 ntdll

The only “relevant” line from our project in the call stack is:

AH2_FactionAiController::AH2_FactionAiController() [c:\4.16\galaxysample\source\galaxysample\private\core\h2_factionaicontroller.cpp:13]

which is defined as:

AH2_FactionAiController::AH2_FactionAiController()
{
	bWantsPlayerState = true;
	//NOTE:Test on final release
	static ConstructorHelpers::FObjectFinder<UBehaviorTree> BehaviorRef (TEXT("BehaviorTree'/Game/Gameplay/Ai/FactionAi/BT_StandardFactionAi.BT_StandardFactionAi'"));
	DefaultBehavior = BehaviorRef.Object;
}

After further testing, by commenting the above code and setting DefaultBehavior = nullptr; in the constructor
the project will crash on other parts or will finish loading into the game (if we leave the list of assets to nativize empty in project settings) but assets are not loaded properly : for example umg button widgets on the HUD don’t function or don’t display their text and the game is unstable / will crash on various things like changing maps.

Beside sharing our project which is very large I am not sure how to go about reproducing this so it can be fixed. I have tried disabling the event loader and the async loader from project settings but it has not had any effect. Any ideas?

link text

Hey Raf-

I added the constructor helper code you provided to an actor class and was able to package/launch the game with the nativized option set to Inclusive. Looking at the provided log, what is the “MissionUnitWave” that is attempting to be processed?

Additionally, are you able to reproduce the behavior in a new project when you add a constructor helper? If so, can you provide the full setup steps used to help me test the behavior on my end?

Hey , MissionUnitWave is a blueprint struct containing :
an enum variable (enum defined in C++) and
an array of unit pawns (our custom pawn class in C++)

Please note that I had also tested with the nativize list empty with the option set to exclusive (just to turn the feature on). It would finish loading and get into the game hud but other things would be broken, things like simple button widgets clicking would not do anything, button names would not be populated etc. My impression was it’s not one specific thing but a whole slew of things weren’t initializing correctly or in the right order perhaps having to do with constructors. And this is only in 4.16 we are seeing it.

I’ll try to reproduce it but it might require a project of a certain size/complexity to manifest.

I’m facing the same issue, nativization set to exclusive and yet empty. The game can package but crash on launch with this same error:

LowLevelFatalError [File:D:\Build++UE4+Release-4.16+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp]

Hey Raf-

Sorry for the delayed response. After further testing I have not yet managed to reproduce this issue locally. Have you managed to reproduce this in a new project?

@Maxime-
Can you provide any additional information about your setup? Is the only steps to set nativization method to Exclusive without adding any blueprints to the list and then attempt to package / launch?

Hey Raf & Maxime -

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Cheers

Ran into the same AsyncLoading assert when using nativized blueprints here. It was also caused by using FObjectFinder to get an instance of a blueprint class in a C++ class constructor. When the default objects are constructed, the loading fails.

The solution was to use LoadObject() instead of FObjectFinder and move the loading from the constructor to an initialization function called later. This way, the default object construction does not attempt to load blueprints.

1 Like