Swift Playgrounds BSActionErrorDomain error 1

I am writing an app in Swift Playgrounds 4.5.1 on an iPad 8th generation running iPad OS 17.5.1. When I click the run button I get the error “MyGame Crashed. Update failed. The operation couldn't be completed. (BSActionErrorDomain error 1.) MyGame may have crashed.” It was working up until a few days ago but now it can’t even show the preview. I haven’t updated the app or software since and I can run other app playgrounds. I have multiple nested views with multiple lists of buttons using ForEach statements and I am sharing variables across views using ObservableObject using code like this:

class UserProgress: ObservableObject {
    @Published var score = 0
}

struct InnerView: View {
    @ObservedObject var progress: UserProgress

    var body: some View {
        Button("Increase Score") {
            progress.score += 1
        }
    }
}

struct ContentView: View {
    @StateObject var progress = UserProgress()

    var body: some View {
        VStack {
            Text("Your score is \(progress.score)")
            InnerView(progress: progress)
        }
    }
}

I am having the same problem on my ipad:

  • Playgrounds 4.5.1
  • iPadOS 17.5.1

I am displaying Picker, inside the block I am iterating over a list of object, using the object itself as tag.

Picker(selection: $selectedItem, label: Text(“example”)) {
    ForEach(items, id: \.id) {element in
        Text(element.prop).tag(element as Item?)
    }
}

We would love to get some diagnostic information to help understand what's happening here! On iPad, when the problem has just reproduced, choose Send Feedback from the "•••" menu. Be sure to tap "Collect and Share Diagnostics" to save the diagnostic information from Previews, then tap "Create New Feedback" and attach the diagnostics you collected to your report.

Thanks in advance!

Swift Playgrounds BSActionErrorDomain error 1
 
 
Q