I was using Office PnP library to create SPOField. I got “Key cannot be null” error. I checked all the options for the XML file. Finally this is the correct XML text worked for the call. Please note there should be default XML Namespace.
You will get same error if you are using the PowerShell Solutions from Office PnP
<?xml version=”1.0″ encoding=”utf-8″?>
<Field xmlns=”http://schemas.microsoft.com/sharepoint/”
ID=”{8478039d-fbd5-421d-bd6c-87a07d7ce499}”
Name=”ContosoStatus”
DisplayName=”Contoso Status”
Type=”Choice”
Required=”FALSE”
Group=”Contoso Site Columns”>
<Default>Draft</Default>
<CHOICES>
<CHOICE>Draft</CHOICE>
<CHOICE>Review</CHOICE>
<CHOICE>Final</CHOICE>
</CHOICES>
</Field>