Swift Playgrounds warning when containing visionOS conditional code.

I'm getting the following error when previewing my Swift Playground package:

Unrecognized platform name 'xrOS'; did you mean 'iOS'?

Anyone know how to silence this? I don't have xrOS anywhere in my code so I'm guessing this is something with Swift Playgrounds or with the compiler.

Answered by kudit in 793107022

Seems to work now that there’s a new version of Swift Playgrounds out that recognizes both xrOS and visionOS compiler flags.

I don't have xrOS anywhere in my code

xrOS is a compatibility synonym for visionOS. I presume you have visionOS code in your playground?

Also:

  • Is this Xcode or the Swift Playgrounds app?

  • What version of that?

  • How do you create your playground?

  • And can you post a small snippet that reproduces the issue?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

Seems to work now that there’s a new version of Swift Playgrounds out that recognizes both xrOS and visionOS compiler flags.

Swift Playgrounds warning when containing visionOS conditional code.
 
 
Q