79706942

Date: 2025-07-19 04:56:32
Score: 1
Natty:
Report link

Today I finally got around to creating multiple schemes for my different environments (local, staging, prod) so I could be a real dev and stop commenting out my different server urls depending on which environment I was building for.

My previews stopped working with the error "Cannot find previews. Check whether the preview is compiled for the current scheme and OS of the device used for previewing...".

Wut.

I must have looked at every possible answer to anything related and tried dozens of "fixes" that didn't work to fix the issue.

I finally figured it out.

The mistake I made that ultimately broke the previews was that I gave each scheme a different "Product Name". If you navigate to your targets build settings: Target -> Build Settings -> Packaging -> Product Name. I wanted each scheme (local, staging, prod) to show up named differently on device. If I had 3 app logos all named MyApp I wouldn't be able to tell them apart. Previews did not like this.

My solution was to keep all "Product Names" the same. Now the previews work for all of my schemes. And the fix to having each scheme show up on device named different was actually to update the "Bundle Display Name" setting: Target -> Build Settings -> Info.plist Values -> Bundle Display Name.

Now my previews work for all schemes and each scheme's app shows up on device with a different name.

:)

cheers

Reasons:
  • Blacklisted phrase (1): cheers
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: BradStell