Description

For unknown reason, the header of BP_Parent is included twice. The second header is located after the .generated.h, causing the compile error.

The following is the include section of BP_Child__pf1010915279.h, which was automatically generated when nativizing:

  #pragma once
  #include "GeneratedCodeHelpers.h"
  #include "Blueprint/BlueprintSupport.h"
  #include "BP_Parent__pf1010915279.h"
  #include "BP_Child__pf1010915279.generated.h"
  #include "BP_Parent__pf1010915279.h"
Steps to Reproduce
  1. Create a Blueprint named BP_Parent that inherits from Character, and then create BP_Child that inherits from BP_Parent.
  2. Add any function that you'd like to BP_Parent.
  3. Add any function that you'd like and an Event Dispatcher to BP_Child.
  4. Create another Blueprint named BP_Other that inherits from Actor. Get BP_Other to reference BP_Child to call its function.
  5. Place BP_Other in the level.
  6. Configure settings for the package in the following way:
    1. BlueprintNativizationMethod = Exclusive
    2. List of Blueprint assets to nativize = BP_Other (Specify only BP_Other for "List of Blueprint assets to nativize".)
  7. With those settings done, packaging the project causes the following error:

UATHelper: Packaging (Windows (64 bit)): E:/TestNative/Intermediate/Plugins/NativizedAssets/Windows/Game/Source/NativizedAssets/Public/BP_Child__pf1010915279.h(6): Error: #include found after .generated.h file - the .generated.h file should always be the last #include in a header
UATHelper: Packaging (Windows (64 bit)): Error: UnrealHeaderTool failed for target 'TestNative' (platform: Win64, module info: E:\TestNative\Intermediate\Build\Win64\TestNative\Development\TestNative.uhtmanifest, exit code: OtherCompilationError (5)).

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-60961 in the post.

19
Login to Vote

Won't Fix
ComponentUE - Gameplay - Blueprint
Affects Versions4.19.24.204.214.224.234.244.254.26
CreatedJun 21, 2018
ResolvedJul 15, 2021
UpdatedJul 19, 2021