[Xcode]Problem in the emulator when uploading files, preview crashed

I have a MacOS M1 device that is updated to the latest version. (Sonoma 14.2)

The codes are from the Swift language, and basic ones such as printing sentence and adding an image were written for an experiment, but an error appears

Error text (“You cannot use this version of the application (project name) with this version of maCos”

I tried all the official and beta versions from the Apple developer website, but to no avail. I exhausted all possible solutions, read and searched a lot, and the error appears itself.

Is there a solution for this?

The latest version of beta 15.2. In the description it was mentioned that the error was resolved, but this is not true