Unable to nativize blueprints referencing generated headers targeting PS4

I have a few blueprints I’m trying to nativize. I’m on 4.19.2 compiling a PS4 target. I’m running into this error:

UATHelper: Packaging (PlayStation 4):   [9/25] orbis-clang.exe Module.NativizedAssets.gen.6_of_7.cpp
UATHelper: Packaging (PlayStation 4):   In file included from D:\FirewallTrunk\Intermediate\Plugins\NativizedAssets\PS4\Game\Intermediate\Build\PS4\Firewall\Development\NativizedAssets\Module.NativizedAssets.3_of_9.cpp:4:
UATHelper: Packaging (PlayStation 4):   In file included from D:\FirewallTrunk\Intermediate\Plugins\NativizedAssets\PS4\Game\Source\NativizedAssets\Private\ABP_PlayerCharacter_Female__pf1127445899.cpp:401:
UATHelper: Packaging (PlayStation 4):   In file included from D:/FirewallTrunk/Source\Firewall/Player/FWPlayerCharacter.h:18:
UATHelper: Packaging (PlayStation 4):   In file included from E:\UnrealDev\UE4.19.2\Engine\Source\../Plugins/Runtime/PS4/Morpheus/Source/Morpheus/Public/MorpheusFunctionLibrary.h:8:
UATHelper: Packaging (PlayStation 4):   E:\UnrealDev\UE4.19.2\Engine\Plugins\Runtime\PS4\Morpheus\Source\Morpheus\Public\MorpheusTypes.h(7,10):  fatal error: 'MorpheusTypes.generated.h' file not found
UATHelper: Packaging (PlayStation 4):   #include "MorpheusTypes.generated.h"

I’ve tried a lot of variations to pick up these headers in my DefaultEngine.ini config:

[BlueprintNativizationSettings]
+FilesToIncludeInModuleHeader="MorpheusTypes.generated.h"
+FilesToIncludeInModuleHeader="MorpheusFunctionLibrary.generated.h"
+FilesToIncludeInModuleHeader="../Plugins/Runtime/PS4/Morpheus/Intermediate/Build/PS4/Firewall/Inc/Morpheus/MorpheusTypes.generated.h"
+FilesToIncludeInModuleHeader="../Plugins/Runtime/PS4/Morpheus/Intermediate/Build/PS4/Firewall/Inc/Morpheus/MorpheusFunctionLibrary.generated.h"
+FilesToIncludeInModuleHeader="../Plugins/Runtime/PS4/Morpheus/Source/Morpheus/Public/MorpheusTypes.h"
+FilesToIncludeInModuleHeader="../Plugins/Runtime/PS4/Morpheus/Source/Morpheus/Public/MorpheusFunctionLibrary.h"

Originally I was having trouble picking up MorpheusFunctionLibrary.h but adding it to the .ini worked. I’ve been unable to pick up any of the generated headers though.

Is this a limitation of the current built in nativization? Are there any work arounds? Thanks!

So you have a native file Firewall/Player/FWPlayerCharacter.h that is including a plugin header …/Plugins/Runtime/PS4/Morpheus/Source/Morpheus/Public/MorpheusFunctionLibrary.h ?

Have you added Morpheus to PublicIncludePathModuleNames or similar in your game module’s build.cs?

Nativized blueprints are compiled into a separate module to your game’s module, so if any of your game module’s public headers include files from another module then that other module needs to be added as a public dependency of the game module.

I was able to resolve this a long time ago. Adding +AdditionalPublicDependencyModuleNames=Morpheus to the [BlueprintNativizationSettings] section of our DefaultEditor.ini config solved the issue.

Were there any other things to troubleshoot in this process?

i’ve got a cpp class myGameInstance that includes a reference to OnlineIdentityInterface.h. Packaging fails because nativization says it can’t find that header. i’ve added OnlineSubsystem and OnlineSubsystemUtils to the AdditionalPublicDependencyModuleNames in BlueprintNativizationSettings.

Documentation says there may be issues with blueprint callable functions, and in a myGameInstance subclass in blueprints, i am using a blueprint callable function which starts a chain of logic which needs that header. Is this the case of a known limitation with nativization?

Did you end up using FilesToIncludeInModuleHeader in DefaultEditor.ini ? Or using only AdditionalPublicDependencyModuleNames did the trick?