Blueprint nativization fails: Map member with own type Object as Key or Value

Hello,

I tried Blueprint nativization with 4.15’s Map container, then got an error.

Here’s my steps:

  1. New blank project.
  2. New BP “NewBlueprint”
  3. New BP “MyActor2”
  4. Add a map variable in NewBlueprint, Name as key, MyActor2 as value
  5. Check both bps nativize
  6. Blueprint nativization method exclusive
  7. Package win64

And have this line:

Packaging (Windows (64-bit)): UnrealBuildTool: D:/Unreal4Works/blank1/Intermediate/WindowsNoEditor/NativizedAssets/Source/NativizedAssets/Public/NewBlueprint__pf1010915279.h(20) : Error: Unrecognized type 'AMyActor2_C' - type must be a UCLASS, USTRUCT or UENUM

In D:\Unreal4Works\blank1\Intermediate\WindowsNoEditor\NativizedAssets\Source\NativizedAssets\Public it has a file MyActor2__pf1010915279.h.

Maybe someone can help to fix?

Thanks

Hello ,

IF you take a look at the error that was provided in your original post you will see that it states “Error: Unrecognized type ‘AMyActor2_C’ - type must be a UCLASS, USTRUCT or UENUM” Meaning that the map that is being used has to have a class, struct, or enum reference. From the steps provided above, it sounds like you are using an actor reference here. Could you try changing this from a reference to the MyActor BP to the MyActor BP class and let me know if the package still fails?

Hello Rudy,

Thanks for the reply.
I tried MyActor2 BP class, it worked.
But in real world case, I need to use reference as key or value.
I also tried to use built-in Actor reference as value, it worked as well.

I noticed that it generated the MyActor2__pf1010915279.h file, but it was looking for AMyActor2_C, that might be ‘AMyActor2__pf1010915279_C’ I guess?

And I tried to add another MyActor2 reference variable ‘myActor’ into NewBlueprint.
In generated file NewBlueprint__pf1010915279.h:

UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, meta=(DisplayName="Map 2", Category="Default", OverrideNativeName="map2"))
	TMap<FName,AMyActor2_C*> bpv__map2__pf;
	UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, meta=(DisplayName="My Actor", Category="Default", OverrideNativeName="myActor"))
	AMyActor2_C__pf1010915279* bpv__myActor__pf;

Maybe there’s a bug in generating custom type name as map key or value?

P.S.
English is not my first language, I’ve tried my best to describe the question.

Thanks.

After doing a bit of digging I was able to find that this is a known issue. I have provided a link to the public tracker. Please feel free to use the link provided for future updates.

Link: Unreal Engine Issues and Bug Tracker (UE-42614)

Make it a great day

Thank you.

Is there already a target release set for this issue? This would be very helpful for the decision whether to use the new Set/Map containers (and just skip nativization until they are fixed) or not to use them if the fix will be some time later.