Issue occurs because there is a legacy code path that forces all interface parameters to be declared as 'const' in function declarations, even if CPF_ConstParm is not set in exported C++ code. This case conflicts with our unsupported 'const ref' term type in Blueprint functions, and is handled for native C++ APIs that are overridden, but not for non-native Blueprint functions, which is how it manifests here.

Steps to Reproduce
  1. Open the attached project (4.25).
  2. Attempt to package it for Win64 (inclusive nativization is already enabled).
  3. A C++ compile error will result after cooking, but before packaging is complete:
    D:/dev/local/Projects/NatInterfaceTest/Intermediate/Plugins/NativizedAssets/Windows/Game/Source/NativizedAssets/Private/BP_A__pf1010915279.cpp(533): error C2662: 'UObject *&FScriptInterface::GetObjectRef(void)': cannot convert 'this' pointer from 'const TScriptInterface<IBP_Interface_C>' to 'FScriptInterface &'
    UATHelper: Packaging (Windows (64-bit)): D:/dev/local/Projects/NatInterfaceTest/Intermediate/Plugins/NativizedAssets/Windows/Game/Source/NativizedAssets/Private/BP_A__pf1010915279.cpp(533): note: Conversion loses qualifiers
    UATHelper: Packaging (Windows (64-bit)): D:\dev\UE4\Dev-Framework\Engine\Source\Runtime\CoreUObject\Public\UObject/ScriptInterface.h(61): note: see declaration of 'FScriptInterface::GetObjectRef'
    UATHelper: Packaging (Windows (64-bit)):
    UATHelper: Packaging (Windows (64-bit)): Error executing D:\dev\UE4\Dev-Framework\Engine\Build\Windows\cl-filter\cl-filter.exe (tool returned code: 2)


Have Comments or More Details?

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

Login to Vote

ComponentUE - Gameplay - Blueprint
Affects Versions4.
Target Fix4.26
Fix Commit13567221
Main Commit13686746
CreatedMay 27, 2020
ResolvedMay 28, 2020
UpdatedOct 9, 2020
View Jira Issue