Failed to prepare for communication with playground for an unknown reason - Xcode 13

Viewed 4064

Playground shows below error and after restart also not working, Any idea how to solve this?

Error: Failed to prepare for communication with playground for an unknown reason

enter image description here

7 Answers

I did the following for it to work for me (XCode 13.2.1, Monterey):

  1. Went to Finder location for the playground
  2. Right clicked on the .playground and clicked "Show Package Contents"
  3. Selected the .workspace item in the package
  4. Ran the playground

Worked fine thereafter!

I did a combination of the two answers above and it to work for me (XCode 13.2.1, Monterey):

  1. Went to Finder location for the playground
  2. Right clicked on the .playground and clicked "Show Package Contents"
  3. Selected the .workspace item in the package
  4. Ran the playground

I had the same error message.

So I closed Xcode completely and reopened it. Then I repeated the same 4 steps above and it worked for me.

I solved it for myself by restarting Xcode. Opening the file again didn't help, but restarting Xcode did...

I had this exact same problem and couldn't find an answer anywhere. I was using Xcode on my 2015 macbook pro and was on Big Sur. All I did was update my system to Monterey and updated xcode and now it doesn't display that error message and I'm able to see the console output on the side panel. Hope it helps everyone with the same issue. Naughty problem to have when you're just starting out with xcode dev.

I fetched the file from the playground app and ran it.

Exit Xcode and then reopen it. Worked for me.

By restarting Xcode 13.4, this question is fixed.

Related