# Adding a package to two targets in one projects results in an error

**URL:** <https://forums.swift.org/t/adding-a-package-to-two-targets-in-one-projects-results-in-an-error/35007>\
**Category:** Using Swift\
**Tags:** packagemanager\
**Created:** [April 1, 2020, 5:11pm UTC](https://forums.swift.org/t/adding-a-package-to-two-targets-in-one-projects-results-in-an-error/35007 "2020-04-01T17:11:40Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![DevAndArtist](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/devandartist/32/287_2.png) [@DevAndArtist](https://forums.swift.org/u/DevAndArtist)\
**Post date:** [April 2, 2020, 5:17am UTC](https://forums.swift.org/t/adding-a-package-to-two-targets-in-one-projects-results-in-an-error/35007/6 "2020-04-02T05:17:36Z")

</div>

Here is my solution to the problem:

> [@Migrating to SPM from mix of embedded frameworks and static libraries](https://forums.swift.org/t/migrating-to-spm-from-mix-of-embedded-frameworks-and-static-libraries/34253/6):
>
> What I did recently was this. I migrated all our org‘s frameworks to SPM and resolved their dependencies. Then to avoid duplicates in the main host app I came up with a good trick that works great for us. Instead of embedding all different libs from packages through Xcode‘s UI, I created a project local package with a single library target/product. This local package would then have all the dependencies for our frameworks, which are now completely migrated to SPM. This moves completely all the …

---

_[View the full topic](https://forums.swift.org/t/adding-a-package-to-two-targets-in-one-projects-results-in-an-error/35007)._
