# 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:** 2

<div class="post-metadata">

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

</div>

It depends on your concrete scenario, this diagnostic is new in 11.4, that's why you did not see it in 11.3.

If an app and an embedded app extension or helper tool statically link the same package product, this error will incorrectly be emitted. In this case, you can set the `DISABLE_DIAMOND_PROBLEM_DIAGNOSTIC` build setting to YES in your app target to disable this diagnostic.

When a binary (such as an app or a framework) uses a statically linked package product, the code from the library is copied into the binary. At runtime, there can be only one copy of the code in each process, so if multiple binaries that will loaded into the same process use the same statically linked package product, this diagnostic is correct and should not be disabled. In this case, restructure your project to use the package product in only one binary, or change the type of the library product to dynamic in its package manifest.

---

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