Failed to Update Preview - Cannot preview in this file

I'm running into an error trying use Xcode Live Previews in my project.

Our main project is really large and previews have never worked there, so I've been creating smaller targets with fewer dependencies and have had some luck getting previews to work there.

So now I'm starting to move a feature over into a Feature Module (an isolated target with tests and an example iOS host app to demo it).

The demo app runs fine, but the previews never work for me.

I filed a FB on this with some detail: FB9162267

Things I have tried:

  • Changing my preview provider to just render Color.blue - same result
  • Looked in ~/Library/Logs/DiagnosticReports for a crash related to the preview agent - nothing
  • Read through the generated report, mentions a Library not loaded @rpath/SomeDependency, but I can see this dependency successfully built in the Derived data build artifacts for the preview build

Project setup is like this:

Example - iOS app Pods - Some internal pods + a few external ones

The internal pods are all path based references, so I can edit them directly in this workspace.

Example app depends on FeatureModuleA which is a framework built by the Pods project.

My preview lives in FeatureModuleA.

Any ideas on what I can do next?

Hi,

Sorry to hear you are having problems getting previews working. It seems you've done some great debugging on your own, and we appreciate the feedback you've filed. I took a look and it seems like it contains all the initial triaging data needed. I've routed it to the right internal team, and hopefully they'll be able to look at it as soon as possible!

Failed to Update Preview - Cannot preview in this file
 
 
Q