Cannot Preview in this file errors

Hello,

I keep getting “Cannot preview in this file - active scheme does not build this file” errors frequently when starting a starter project for each chapter. Sometimes doing a clean then build fixes it, sometimes closing the project then reopening it fixes it.

I see this frequently, what am I missing?

Thanks,

GreyBeard

hi Warren! which destination target are you using?

in Xcode 13.1, I’m getting a different but similar preview error, only for some older simulator devices, like SE and 8:

Screen Shot 2021-11-04 at 11.32.17

I had expected to see your error for the newer devices, since the book’s code targets iOS 14, not 15. But new devices aren’t a problem.

Hi Audrey,

I’m building for iPad Pro on iOS 14.0.
I’m using xcode 13.1 running under Monterey 12.0.1.
Preview is now working after closing xcode then re-opening it.

I thought Android Studio was flaky but this is a whole new level of flakiness.
I did iOS dev years ago and xcode was very stable and reliable then.

Thank you for responding,

Warren

Jobs ran a very tight ship.

OTOH Xcode now needs to support a lot more features.