# How to exclude SPM dependency for Catalyst?

**URL:** <https://forums.swift.org/t/how-to-exclude-spm-dependency-for-catalyst/44957>\
**Category:** Using Swift\
**Tags:** off-topic, packagemanager, catalyst\
**Created:** [February 21, 2021, 6:03pm UTC](https://forums.swift.org/t/how-to-exclude-spm-dependency-for-catalyst/44957 "2021-02-21T18:03:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mezhevikin](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mezhevikin/32/15467_2.png) [@mezhevikin](https://forums.swift.org/u/mezhevikin)\
**Post date:** [February 21, 2021, 6:03pm UTC](https://forums.swift.org/t/how-to-exclude-spm-dependency-for-catalyst/44957/1 "2021-02-21T18:03:48Z")

</div>

Hi, guys!

I created a empty Xcode project with catalyst support and added one dependency YandexMobileMetrica via Swift Package Manager.

YandexMobileMetrica not support Catalyst architecture, so I need exclude this framework for macOS.

I opened section "Frameworks, Libraries" and I switched value from "iOS + macOS" to "iOS".

Then I wrapped the code:

`Code Block #if !targetEnvironment(macCatalyst)import YandexMobileMetrica#endif`

But I'm getting an error:

`Code Block languageWhile building for Mac Catalyst, no library for this platform was found in '/Users/mezhevikin/Library/Developer/Xcode/DerivedData/catalyst-spm-test-gapaedifaylhvwatazbwfppyplvj/SourcePackages/artifacts/YandexMobileMetrica/YandexMobileMetricaCrashes.xcframework'.`

[https://github.com/mezhevikin/catalyst-spm-test](https://github.com/mezhevikin/catalyst-spm-test) - example of problem

How to exclude SPM dependency for Catalyst?

---

<div class="post-metadata">

**Author:** ![paulb777](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/paulb777/32/7986_2.png) [@paulb777](https://forums.swift.org/u/paulb777)\
**Post date:** [February 25, 2021, 5:24pm UTC](https://forums.swift.org/t/how-to-exclude-spm-dependency-for-catalyst/44957/2 "2021-02-25T17:24:04Z")

</div>

Similar question to [Disabling binary dependencies for Catalyst](https://forums.swift.org/t/disabling-binary-dependencies-for-catalyst/42444) that that has gone unanswered since December.
