Playground app won't run on Swift Playgrounds?

My playground app runs perfectly fine when I compile it on Xcode on my Mac to run it on my iPad, but for some reason it won't run at all when I try running it directly on Swift Playgrounds (the file opens and it doesn't give me any errors, but it won't compile). How might I be able to fix this?

My app is a .swiftpm file and I'm using Swift Playgrounds 4.0.2 on iPadOS 15.4.1.

Any help would be greatly appreciated!

Answered by CodeSwift in 711074022

Okay, so it looks like Swift Playgrounds apparently compiles differently from Xcode so it wouldn't compile because of a style "error" (left a bracket on the same line as some other code) despite still compiling on Xcode. Moving it to a new line seems to have fixed my issue.

I'm having the same issue on MacOS 12.3 with Playgrounds 4.0. The playground book (.playgroundbook) opens fine, but when I press run it just spins and does nothing. It was working fine earlier today, and I haven't made any major changes since then. Mine, like yours, is also showing no errors of any kind. This is very frustrating.

Accepted Answer

Okay, so it looks like Swift Playgrounds apparently compiles differently from Xcode so it wouldn't compile because of a style "error" (left a bracket on the same line as some other code) despite still compiling on Xcode. Moving it to a new line seems to have fixed my issue.

Playground app won't run on Swift Playgrounds?
 
 
Q