Constructing a ReceiptProperty object is deprecated

Hello,

I’m running out of ideas. Turning out to the community for some help.

Migrating to 4.20 from 4.19, I am getting this error for my Android manifest:

'UnrealBuildTool.ModuleRules.ReceiptPropertyList.Add(UnrealBuildTool.ReceiptProperty)' is obsolete: 'Constructing a ReceiptProperty object is deprecated. Call ReceiptProperties.Add() with the path to the file to stage.'

The original code in the build manifest is:

string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
AdditionalPropertiesForReceipt.Add(new ReceiptProperty("AndroidPlugin", Path.Combine(PluginPath, "AndroidManifest_UPL.xml")));

When I replace this code with the suggestion from the compiler, I get:

error CS0103: The name 'ReceiptProperties' does not exist in the current context

I can’t make sense of this error and could not find related documentation. Any hint would be much appreciated.

Fen

Hi Fen,

I just hit this one myself. Looking at the API, it seems they’ve just made a new two argument add function, which internally constructs the ReceiptProperty. So all you should need to do is drop the ReceptProperty construction, giving the arguments you gave to the construction to the Add function instead.

i.e. AdditionalPropertiesForReceipt.Add(“AndroidPlugin”, Path.Combine(PluginPath, “AndroidManifest_UPL.xml”));

Cheers,

Alan.