This result does happen with a small sample project. I can't upload the zip file here, but it is attached to the original Feedback (FB16442048).
Post
Replies
Boosts
Views
Activity
@DTS Engineer this doesn't actually answer my questions though. I understand that the app is crashing because of a deadlock in CoreData, but as I mentioned I’m not doing any long running tasks. There have been instances where I’m not doing any work, other than just opening the application and then it crashes in the background. The "long running task" you reference has to be coming from the CloudKit integration with CoreData. Thats what I’m asking for a solution to. How do I prevent that from crashing the application, as CloudKit is internally managed.
I tried a few days later and although it first appeared to give me the same issues, after a few browser refreshes the environment was able to be reset. After that I was able to push the schema was able to production after a few more refreshes.
Seems like it was just something on the CloudKit backend. I don't believe it was schema related as I only had two basic objects. It was also happening with a new CloudKit Container.
I’m using SwiftUI to present the view. Below is the relevant code. When I change it to presenting modally in SwiftUI using sheet or fullScreenCover, it does present.
I didn't even know that was tappable, but when I do it does open GameCenter in app.
public var body: some View {
ZStack {
switch gameKitManager.status {
case .authenticated:
Color.accentColor
.edgesIgnoringSafeArea(sizeClass == .compact ? .top : .all)
.opacity(0.6)
ProgressView()
.scaleEffect(1.5)
GKGameCenterView(dismiss: dismiss)
.edgesIgnoringSafeArea(sizeClass == .compact ? .top : .all)
.opacity(showGameKitCenterView ? 1 : 0)
.onAppear {
withAnimation(.linear(duration: 0.75)){
showGameKitCenterView = true
}
}
case .notAuthenticated(let vc):
GKAuthenticationView(vc: vc)
case .error(let error):
createErrorView(error)
case .none:
authenticateButton()
}
}
.navigationBarHidden(true)
.navigationTitle("Achievements")
}
public struct GKGameCenterView: UIViewControllerRepresentable {
let viewController = GKGameCenterViewController()
let dismiss: ()->Void
public func makeUIViewController(context: Context) -> GKGameCenterViewController {
viewController.gameCenterDelegate = context.coordinator
return viewController
}
public func updateUIViewController(_ uiViewController: GKGameCenterViewController, context: Context) {
}
public func makeCoordinator() -> Coordinator {
return Coordinator(self)
}
@MainActor
public final class Coordinator: NSObject, @preconcurrency GKGameCenterControllerDelegate {
let parent: GKGameCenterView
// MARK: - Initializer
init(_ parent: GKGameCenterView) {
self.parent = parent
}
// MARK: - GKGameCenterControllerDelegate
public func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) {
gameCenterViewController.dismiss(animated: true, completion: nil)
parent.dismiss()
}
}
}
After digging in a bit more, it appears that the view controller has to be presented via a sheet or full screen modal. Previously I was using a switch statement to show the view and that is no longer working. However, this workaround still has some bugs revolving around the view controller so it still doesn't not work for my needs.
Feedback: FB14368686
What is the solution here? I’m running into the same problem.
I’m seeing the same behavior on the released version of Xcode 15.2. It works just fine on the iOS 17.0 simulator, but 17.2 crashes on launch with "EXC_BAD_ACCESS".
usesBottomSafeArea is a new property introduced in iOS 17 to address this. Watch Keep up with the keyboard for more info.
view.keyboardLayoutGuide.usesBottomSafeArea = false
NSLayoutConstraint.activate([
collectionView.topAnchor.constraint(equalTo: view.topAnchor),
collectionView.bottomAnchor.constraint(equalTo: view.keyboardLayoutGuide.topAnchor),
collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])
I have also not been able to get AppIntentsPackage working. I’m copying and pasting the example from Apples documentation, but no shortcuts appear in the shortcuts app.
We are having the exact same problem. Only lower iOS 15 physical devices are effected, it causes a crash, and it seems to do with Swift Concurrency. From our testing it appears that async let may be apart of the issue. To solve this problem in the short term, we also had to put out a hot fix to revert back to Xcode 14.2.
Did you ever find a solution?
I’m also having this issue (Instruments 14.0.1). Did you ever find a fix?
I ended up having to create a UICollectionViewCompositionalLayout subclass, but the solution works really well. You can see the complete solution here.
Same issue with me.