xcodedependency-managementswift-package-managerswift-package

Xcode error 'can not resolve package dependency graph' when overriding a dependency with a local package for package editing


I have an Xcode project with a package dependency and want to add that package dependency locally for editing within my app project, but Xcode reports an error when trying to add the package locally.

Apple docs reference: Editing a package dependency as a local package

What I have tried:


Solution

  • With Xcode 15.2 I successfully added the cloned package as a local package for editing, by dragging and dropping the local package into my Xcode project right below the project name, instead of using File/Add Package Dependencies...

    Xcode does override the (remote) package dependency. It shows this by removing the package dependency from the Project Navigator.

    NOTE: the folder name of the folder that contains the local package needs to match the name of the package in the git repo for the drag and drop to be successful.

    If you remove the local package again, the remote package dependency shows up again in the Project Navigator.