Duplicate elements of type 'PBXFileElement' were found in a Set
We are seeing this error regularly:
⚙️ Generating plists...
⚙️ Generating project...
Fatal error: Duplicate elements of type 'PBXFileElement' were found in a Set.
This usually means either that the type violates Hashable's requirements, or
Our project is quite large, but we have no insight into what is going on here. Re-running xcodegen solves this, so it's likely a race condition somewhere. I've got a PR which adds some debug logging to hopefully help try and track it down: https://github.com/yonaskolb/XcodeGen/pull/1128
I have exactly the same problem on our build machine, starting to become quite annoying... Any ideas on what's happening?
Thanks!
Any updates on this? We are still seeing this.
Gave a look at this yesterday, as we were having the same issue breaking our CI randomly.
Basically, XcodeProj's PBXObject and inherited classes are not respecting Hashable requirements. Two different instances (not equal) can have the same hash, which leads randomly to this issue.
Tried to fix that naively, to realise it was more complex, so closed my Fix above.
Does someone find a fix for this yet? I just ran to this error today.
I now work for a different company and I'm seeing the same error 😞
Thankfully my new project reproduced the issue much more frequently and I was able to create a fix: https://github.com/yonaskolb/XcodeGen/pull/1341
Note: There may be multiple reasons for this error, but my fix corrects the one I'm seeing now at least. Try it and see if it fixes your own.
Yes, it should work, this is how I fixed the issues on our side, avoiding the collision, by manually removing some trailing /.