UMaterialInstance causes freeze on splash screen on Android, works on iOS

Hi Epic Games,

I’m writing in to report a bug that was driving me crazy after I updated from UE 4.13.2 to UE 4.17.2. I consider this bug extra nasty because the exact same source code works without any assertions or crashes on Windows and iOS, but freezes on Android.

Inside the constructor of my game mode, I’m using

ConstructorHelpers::FClassFinder<AMeshActor> Type

to get a pointer to the class of a data only blueprint which the game mode will spawn later on. I’m initializing the TSubclassOf inside the constructor to set a default value which I can then override in the level editor.

When executing the FClassFinder, it will also execute the constructor of the base type from which the data only blueprint is derived. Inside that constructor, I use an

ConstructorHelpers::FObjectFinderOptional<UMaterialInstance> MaterialActive;
MaterialActive(TEXT("/Game/M_Gem_Red_A.M_Gem_Red_A"))

for getting a material instance which I then store in a property:

UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
class UMaterialInstance* MaterialDefault;

using

MaterialDefault = ConstructorStatics.MaterialActive.Get();

and that causes my game to freeze at the splash screen on android.

The exact same source code compiles and works just fine on Windows and iOS, so this bug seems to be specific to Android. Also, it appears that the same source code worked with 4.13.2 on Android.

Cheers,

As a workaround, I moved from ConstructorHelpers::FClassFinder to creating a derived blueprint class in the editor and populating the list in there. That works everywhere.

So this bug seems to be related to how classes are loaded by ConstructorHelpers::FClassFinder, as opposed to being referenced by a blueprint.

We encounter the same issue. UE 4.17.2, Android 7.0 Nougat.

The UGameplayStatic::LoadClass call also seems to cause the same issue. As a workaround, we also used a blueprint.

Do you know whether UE4.18 fixed this problem?