I’ve tried to fix this by editing Package.Template.xml with no luck. Even though I removed the duplicate entries, the project still wouldn’t deploy or get packaged.
So finally it hit me to edit the csproj file, and bingo – it had the duplicate entries for those file. Removed those, and that was it!