macOS Sequoia SwiftUI crash

I encountered a crash with my SwiftUI app for macOS. NSInvalidArgumentException: -[MTLIGAccelRenderCommandEncoder setVertexBuffer:offset:attributeStride:atIndex:]: unrecognized selector sent to instance

struct ContentView: View {
    @State var text = ""
    var body: some View {
        TextEditor(text: $text)
    }
}

When I run macOS app, console print NSBundle file:///System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed

and I found it crash with TextEditor. Can somebody help me?

I have the same issue with iOS18: NSBundle file:///Library/Developer/CoreSimulator/Volumes/iOS_22A3351/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS%2018.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed

I think NSBundle file:///System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed is a bug. I get the same warning with iOS18 final but it doesn't crash. I guess they will fix it next release

https://github.com/flutter/flutter/issues/150227 as kaiwen-wang post, turn off Shader Validation. I turn off API Validation and Shader Validation, and it will not crash.

macOS Sequoia SwiftUI crash
 
 
Q