# Xcode 12.5b2 - unit testing target compile error with SPM dependency

**URL:** <https://forums.swift.org/t/xcode-12-5b2-unit-testing-target-compile-error-with-spm-dependency/44882>\
**Category:** Using Swift\
**Tags:** packagemanager\
**Created:** [February 18, 2021, 2:10pm UTC](https://forums.swift.org/t/xcode-12-5b2-unit-testing-target-compile-error-with-spm-dependency/44882 "2021-02-18T14:10:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lukeredpath](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lukeredpath/32/12588_2.png) [@lukeredpath](https://forums.swift.org/u/lukeredpath)\
**Post date:** [March 11, 2021, 2:23am UTC](https://forums.swift.org/t/xcode-12-5b2-unit-testing-target-compile-error-with-spm-dependency/44882/2 "2021-03-11T02:23:29Z")

</div>

This is still failing in 12.5b3 - is this an Xcode or an SPM bug?

Update: I may have found a workaround. If I remove the dependency on "MyLibrary" from "MyLibraryTestHelpers" (so it has no dependencies), then I can build my app for testing and run my unit tests just fine.

Of course, this means I can no longer compile "MyLibraryTestHelpers" in isolation using the Xcode scheme for that library - it complains about "No such module" because its trying to import MyLibrary and I'm no longer including it in its dependencies.

I feel like it should be declaring the modules it depends on but doing that prevents me from building my app test target. Removing them flips it around. I can probably live with this but there must be either a bug or I'm missing something obvious.

I've tried setting MyLibrary as dynamic to see if that solves the problem but then I just run into a code signing issue like this: [Xcode 12.5 and automatic dynamic linking of products](https://forums.swift.org/t/xcode-12-5-and-automatic-dynamic-linking-of-products/45197)

---

_[View the full topic](https://forums.swift.org/t/xcode-12-5b2-unit-testing-target-compile-error-with-spm-dependency/44882)._
