I have this very odd problem with my code, and it\'s a pretty new problem, considering I didn\'t have it half a year ago. Long story short, I\'ve made an app in Xamarin, and
The Preserve attribute is a more focused way to ensure a member is not removed by the linker if you still prefer it to generally do it's thing with your code.
Example:
[Preserve]
[JsonConstructor]
private AlertRequest(bool fake_arg)
{
// fake_arg is to have a unique ctor that we exclusively
// use in JSON de-serialization via JsonConstructor attribute.
// Preserve attribute ensures Xamarin linker does not remove,
// as there are no direct uses of this ctor in the code base
}
In the 'Android options' tab of the project properties, there is a 'linker' tab. Is the selected option in the 'Linking' dropdown "Sdk Assemblies only" or is it "Sdk and user assemblies"?
If it is the latter, the parameterless constructor is skipped when linking, because no use is detected. So change it to "Sdk Assemblies only".