Native Blueprint Code generations create wrong includes.
Hello guys, hope this will be helpful :)
n my project i tried for the first time the blueprint nativization procedure, and it failed strangely. Digging it, i found out that it was generating the wrong includes for the blueprints.
In fact, it was skipping a parent include for some classes, for example if i had:
int the C class header it was correctly extending B, but it was including A directly, resulting in a compiling failure (unknown class B).
I had an hard time reproducing it on a fresh project, below you can find the steps.
It's kinda hard to reproduce it, but this way it fails most of the times.
How to reproduce
Note: Since testing it requires packaging, i suggest to disable "Full rebuild": i tested with it too, the result is the same.
Note 2: This steps list will show a setup for a working project, then will show how to mess it up, and how to workaround it.
Tested on 4.15.1-0
Initial setup to a working project:
Create the problem:
In fact, looking at the generated code, in Intermediate/WindowsNoEditor/NativizedAssets/Source/Public/SecondBP__.h, we have:
Notice how it's including MyStaticMeshActor.h instead of MyBase_C__pf1010915279.h
On exclusive nativization, seems like it fails to generate the correct includes if the parent is a data-only blueprint. In fact, in the SecondBP_.h it places:
As already stated, it seems directly related to data-only blueprint, but it doesn't happen on an inclusive nativization.
It should always generate the correct include (with the right parent class).
I had an hard time tackling this, it seemed pretty randomic, and i lost a lot of time due to the numerous packaging launches.
I noticed that sometimes it still work, but trying around i can always make it fail in the same way (this is the simplest i found).
I hope this can help you, and maybe others that had issues like me, with the workaround.
Let me know if you need more infos :)
[edit1] : fixed some typos.
Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here https://issues.unrealengine.com/issue/UE-44488 . You can track the report's status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.
answered Apr 28 '17 at 01:44 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here