Swift 3: (but also the older versions) it happen when I have assets with duplicates. Just rename the files with this issue and all go well.
It could happen also when you have made a Assets.xcassets
and you have renamed the duplicates with new names so after time you forgot it and remove it to add the folder references but this one return to the duplicate files problem..