Packaging fails with nativize assets if a Blueprint Function Library's function is marked as Const

Hello, I’ve been trying to package my game with the Nativize Blueprint Assets flag on but it doesn’t work. After poking around a bit, I found that the generated C++ files showed errors in mostly Blueprint Function Libraries and it always turned out to be functions marked as Const, with errors like:

...\MyProject\Intermediate\WindowsNoEditor\NativizedAssets\Source\NativizedAssets\Private\TestFuncs__pf3688439234.cpp(36): error C2355: 'this': can only be referenced inside non-static member functions or non-static data member initializers
...\MyProject\Intermediate\WindowsNoEditor\NativizedAssets\Source\NativizedAssets\Private\TestFuncs__pf3688439234.cpp(36): error C2227: left of '->bpf__TestFunction__pf_Inner_0' must point to class/struct/union/generic type

The function tested resides in a Blueprint Function Library and looks like this:


In summary, to reproduce this:

  1. Create a new blank blueprint project.
  2. Create a new Blueprint Function Library.
  3. Create a new function in it and mark it as const.
  4. Set Nativize Blueprint Assets on.
  5. Package game (Windows (64-bit)).

Expected: game is sucessfully packaged.

Result: packaging fails due to errors in the generated C++ files. Note that Blueprint Actor Const functions compile correctly.

Thanks in advance.

Hey VitorCBSB-

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here Unreal Engine Issues and Bug Tracker (UE-39518) . 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.

Cheers