Watch app built with Xcode 12 b6 crashes on watchOS 6.2

I have a watchOS app that targets watchOS 6.2 and using SwiftUI. The app (built with Xcode 11.6) is currently live in the App Store.

If I take that exact same code — no changes to project files or the minimum version or anything! — and build it with Xcode 12 beta 6, the app crashes on launch on watchOS 6.2. This happens in both the debug simulator and on-device via TestFlight.

Crash logs show an EXC_BAD_ACCESS deep in the SwiftUI framework. Please see attached crash log.

Anyone else seeing this? Any suggestions?
(Filed as FB8555637)





It seems to be something to do with FetchRequest… if I comment that out, the rest of the app runs fine.

I have a second List and FetchRequest in my app that also crash. I don’t know if it’s related to the other crash, but it has a different error so I’m attaching that here along with some code.

Code Block Swift
struct RecentlyDeletedView: View {
    @Environment(\.managedObjectContext) var managedObjectContext
    @FetchRequest(
        fetchRequest: CheatManager.deletedCheatFetchRequest()
    ) var cheats: FetchedResults<CSCheat>
    
    var body: some View {
        List(cheats, id:\.self) { cheat in
            NavigationLink(destination: DeletedDetailView(cheat: cheat)) {
                CheatRow(cheat: cheat)
            }
        }
        .navigationBarTitle("Recently Deleted")
    }
}

So it looks like both crashes occur when I try to call/use fetchRequest.wrappedValue in a View body.

It could be an issue with my model or the CSCheat object, which is an Obj-C class? I don’t think it’s that I’m using an NSFetchRequest to build my FetchRequest — I tried replacing it and that still failed:
Code Block Swift
@FetchRequest(
entity: CSCheat.entity(), sortDescriptors: []
) var cheats: FetchedResults<CSCheat>



I have virtually the same crash log and situation but I don't have any @FetchRequest in my watch app... So I'm still lost. :T

Was it just a guess to try commenting out FetchRequest, or did you have a clue about that?
It's looking like this crash may be caused by .listRowPlatterColor(). Replace it with .listRowBackground()
It has been reported here: https://developer.apple.com/forums/thread/659556
Watch app built with Xcode 12 b6 crashes on watchOS 6.2
 
 
Q