最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

xcode - Error when running Previews in a Swift Package: XCPreviewAgent crashed because "Testing.framework" is

programmeradmin0浏览0评论

I moved all of my snapshot dependencies and some utility code that simplified my testing to a separate Package, so I didn't need to import all of my snapshots dependencies in every Package I wanted to use snapshot testing. The importing Package and the Snapshots Packages are both Local Swift Packages.

I am getting the following error while trying to run Previews:

XCPreviewAgent crashed because "Testing.framework" is missing

  • The Package builds
  • The Previews work when I remove the imported Package

The Package I'm importing relies on which in turn relies on swift-snapshot-testing

I moved all of my snapshot dependencies and some utility code that simplified my testing to a separate Package, so I didn't need to import all of my snapshots dependencies in every Package I wanted to use snapshot testing. The importing Package and the Snapshots Packages are both Local Swift Packages.

I am getting the following error while trying to run Previews:

XCPreviewAgent crashed because "Testing.framework" is missing

  • The Package builds
  • The Previews work when I remove the imported Package

The Package I'm importing relies on https://github/doordash-oss/swiftui-preview-snapshots which in turn relies on swift-snapshot-testing

Share Improve this question asked Mar 12 at 8:10 Lucas van DongenLucas van Dongen 9,8887 gold badges43 silver badges62 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

It turns out that the PreviewSnapshotsTesting part relies on Testing.framework and this clashes with a non-testing target that Previews require. I split up my Snapshots Package in two targets, one to be imported by the target that does Previews, the other one by the test target.

Everything works again.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论