Error parsing file: Element recordTypeVisibilities is duplicated at this location

Today, I ran in to this issue while deploying one of the permission set. Error message showing like this, Error parsing file: Element recordTypeVisibilities is duplicated at this location in type permissionset. and it has some line number: x. it can also get for other permissions in profiles or permissionsets.

lets watch the code where we got this issue:

<recordtypeVisibilites>
	<recordType>account.test2</recordType>
	<visible>true</visible>
</recordtypeVisibilites>
<tabSettings>
	<tab>Account</tab>
	<visibility>visible</visibility>
</tabSettings>
<recordtypeVisibilites>
	<recordType>account.test1</recordType>
	<visible>true</visible>
</recordtypeVisibilites>
<recordtypeVisibilites>
	<recordType>account.test3</recordType>
	<visible>true</visible>
</recordtypeVisibilites>
we can have multiple permissions in one permissionset, but all similar type of permissions should be grouped into one location. Having same permissions in one place is good practice to maintain and easy to find.
In above code, we have moved recordtypeVisibilites to one place, then issue got resolved. 

Fixed code for Element recordTypeVisibilities is duplicated

<tabSettings>
	<tab>Account</tab>
	<visibility>visible</visibility>
</tabSettings>
<recordtypeVisibilites>
	<recordType>account.test2</recordType>
	<visible>true</visible>
</recordtypeVisibilites>
<recordtypeVisibilites>
	<recordType>account.test1</recordType>
	<visible>true</visible>
</recordtypeVisibilites>
<recordtypeVisibilites>
	<recordType>account.test3</recordType>
	<visible>true</visible>
</recordtypeVisibilites>
Labels:
Join the conversation