No playgrounds work "Could not build Objective-C module 'SwiftUI'"

I am unable to run even the simplest of Swift Playgrounds. It's as if the fundamental libraries are missing, but in Xcode I am able to build and run SwiftUI applications.

From the main screen under More Playgrounds I click on the App template and before I make any changes it tries to build and fails as per screenshot, with errors such as

"Could not build Objective-C module 'SwiftUI'"

"Could not build module 'Application Services'"

Mac OS 12.6.2

Xcode 14.2

Playgrounds 4.1

Answered by Ni77 in 742066022

I have to revise my statement above.

I was able to solve the problem by uninstalling Playgrounds completely and then reinstalling it. Unfortunately, I can't explain what the problem was with the first uninstall. The only difference in my second attempt was that I both backed up and then deleted all my Playgrounds and uninstalled it in an administrative (a different) account.

I have encountered a very similar problem on my end. Since updating to Playgrounds version 4.2.1 (from 4.0) neither the old Playgrounds "Learn to code 1", "Learn to code 2" nor a current one like "Get Started with Apps" work. I am also able to run Swift based apps in Xcode.

I have tried reinstalling Playgrounds, reinstalling Xcode. All without success. I also contacted Apple support (chat), but they couldn't help me. They suggested me to reinstall Playgrounds.

Mac OS 13.1

Xcode: 14.2

Playgrounds: 4.2.1

This is what the error message looks like when I run an "old" Playground (e. g. "Learn to Code 1").

Accepted Answer

I have to revise my statement above.

I was able to solve the problem by uninstalling Playgrounds completely and then reinstalling it. Unfortunately, I can't explain what the problem was with the first uninstall. The only difference in my second attempt was that I both backed up and then deleted all my Playgrounds and uninstalled it in an administrative (a different) account.

Well that does seem to have fixed it for me. I had a clean slate with no Playgrounds saved. I created a new one from the App template and it failed as above, so I deleted it. Then I deleted the app via Mission Control (I think that is what it is called, the Expose like view with the randomly sorted application icons, a bit like like iOS), then reinstalled it from the Mac App Store and created another one from the App template, and it works!

I did nothing else in-between, not even checking my emails. Fail -> uninstall -> reinstall -> work. A relief, but quite disappointing really.

No playgrounds work "Could not build Objective-C module 'SwiftUI'"
 
 
Q