Using a map in an interface function makes nativizated build fail

I’m trying to make a build of my game (inclusively nativized), and I keep getting this error (Attached) that makes the build fail. It’s referring to an interface function in my AI controller that gets a map of strings to floats. I’m using this to hold all my cooldown floats in one place. While the AI controller has this interface, it doesn’t use this particular function. I’ve tried several things already to solve the problem and this is what I’ve found so far:

  1. The problem is not exclusive to, and probably not even caused by, the AI controller. I moved this function to a different interface and I get the same error with my AnimBP_FirstPerson blueprint instead. Since “AI” would be alphabetically before “Anim”, I’m assuming UE builds things in alphabetical order and it’s just breaking at the first instance of this problem before it can actually tell all of the places it appears.
  2. I have tried making a map and attaching it to the function in the AI Controller, it did nothing.
  3. Deleting/editing/moving the function does nothing to help. The map in question is a string to float map. I’ve tried text and name to float and the same thing happens. Renaming the pin also doesn’t help.
  4. I have deleted the Saved and Intermediate folders. still, nothing.
  5. I suspected it could be a bug with the engine, so I tried updating to 4.23 and building there. still, same error. So either it isn’t a bug with the engine or it is one that has carried over from 4.22 to 4.23.
  6. Due to the build breaking as soon as it finds the first instance of the problem, it’s entirely possible that it’s maps themselves that are broken, and this is just the first time maps show up when it builds.
  7. One thing I have noticed is in the error, it gives me a pathname -
    “‘MapProperty /Script/NativizedAssets.AI_GenericController_C__pf3605976607:bpf__GetxCo
    oldowns__pfT.bpp__Cooldowns__pf’” I notice there is a space after “MapProperty” could this be the mistake that’s causing it? idk but it looks out of place to me. I don’t even know how I would fix that, or where I’d go to do so.

I’ve spent at least 24 hours trying to fix this and having it fail after updating the engine was the last straw for me. So I’m asking for help here. is this a bug with the engine? I’m new to using maps, could I be using them wrong? what is it? I really hope I don’t have to redo this particular system without maps, but if I don’t solve this soon I might have to.

EDIT: I decided to test my theory about it being an engine bug. I opened a blank C++ project in 4.22 (same as my project) created a blank actor and added an interface with 1 function. it has a string-float map as the output pin. I then set the build to inclusive nativized mode and attempted a build. it failed. I was curious if maps are the only thing affected, so I changed the map to a set and it also failed! same error too, but it says "SetProperty " with a space on the end now rather than “MapProperty”. Changing the pin to an array made the build succeed. So is this an engine bug? This can’t possibly be intended behaviour, right?

Nativization has a huge amount of similar issues. It’s not an intended behavior, but an expected one. There are many TMap bugs recorded in the bug tracker, but you can submit this one too if it’s not already present there. Personally, after some time I just stopped reporting nativization bugs, as there are so many, and the recorded ones are not being fixed anyways. I didn’t feel like it’s worth the effort.

In general, there are many unexpected things that break during nativization which are extremely hard to track down, and they heavily limit the Blueprint capabilities: you can’t use TMap in this context, you can’t use that type of widget hierarchy, you can’t connect nodes that way… et cetera. And of course none of these are documented, you just stumble upon a random crash and you try to track them down slowly.

Alternatively, you might try to move some parts to C++ with which nativization has problems, that usually helps.