Error "The workspace contains multiple references with the same GUID" · Issue #1554 · yonaskolb/XcodeGen · GitHub
Skip to content

Error "The workspace contains multiple references with the same GUID" #1554

Open

Description

@niklas-tag24

Everytime I execute xcodegen in my project, and then build the iOS app, I receive the same error

Build service could not create build operation: unable to load transferred PIF: The workspace contains multiple references with the same GUID 'PACKAGE:1YPFJ9C2MTIAXFLQNBJR1G6455KB9KR79::MAINGROUP'

I always have to close and re-open Xcode in this case, which really hinders programming.

I don't really understand how this can even happen. xcodegen basically only rewrites the pbxproj-stuff without using internal xcode APIs like xcodebuild, right? So why does the build operation complain, does someone have an idea?

I also analysed the pbxproj-changes that xcodegen applies. The weird thing is, even if there are no changes at all (because I've executed xcodegen beforehand) then I also get the same error as before.

So if xcodegen doesn't use Xcode API (I suppose), and there are no changes to the .pbxproj-Stuff, what could xcode even complain about?

Activity

  1. yonaskolb commented on Jul 2, 2025

    @yonaskolb
    Owner

    Do you have duplicate packages referenced in your project spec?

  2. niklas-tag24 commented on Jul 9, 2025

    @niklas-tag24
    Author

    Only through transitive dependencies. We have an SPM-Package A that includes B, and we also have to include B ourselves in the project spec again to use it in the main app.
    And sorry for the late response, I haven't received any notification.

  3. niklas-tag24 commented on Jul 11, 2025

    @niklas-tag24
    Author
  4. niklas-tag24 commented on Jul 16, 2025

    @niklas-tag24
    Author

    I've create a minimal "working" example here https://github.com/niklas-tag24/ExampleXcodegenIssue

  5. niklas-tag24 commented on Jul 29, 2025

    @niklas-tag24
    Author

    @yonaskolb Have you already found the time looking at the minimal example I've provided?

  6. yonaskolb commented on Jul 30, 2025

    @yonaskolb
    Owner

    Hi @niklas-tag24, I tried your project and could reproduce that generating while the project is open leads to the error Missing package product 'MyPackage'. I believe it's due to a long standing bug in Xcode https://forums.swift.org/t/missing-package-product-error-for-all-local-swift-packages-when-switching-git-branches/38041/54. Sorry I can't offer more help

  7. yonaskolb commented on Jul 30, 2025

    @yonaskolb
    Owner

    Xcode just doesn't like when it's project changes out from underneath it, even in branch switching scenarios

  8. niklas-tag24 commented on Jul 30, 2025

    @niklas-tag24
    Author

    Thank you for your reply. :) So it seems that the only "fix" would be to remove local packages from our app, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions