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 badges1 Answer
Reset to default 1It 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.