Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwiftUI Preview error (process launch failed)

Tags:

swift

swiftui

It seems that somehow i am screwing the SwiftUI Preview. When loading the simplest Preview like

struct MaterialView_Previews: PreviewProvider {
    static var previews: some View {
        Text("Hello, World!")
    }
}

it crashes with following error:

RemoteHumanReadableError: The operation couldn’t be completed. Transaction failed. Process failed to launch successfully. (process launch failed)

BSTransactionError (1):
==transaction: <FBApplicationProcessLaunchTransaction: 0x6000012e01c0>
==error-description: Process failed to launch successfully.
==error-reason: process launch failed
==NSLocalizedFailureReason: Transaction failed. Process failed to launch successfully. (process launch failed)

I can't figure out what causes this issue since i can run my app in the simulator w/o any errors. I use XCode 12 Beta 4. Any ideas?

like image 878
Deitsch Avatar asked Jun 30 '26 00:06

Deitsch


2 Answers

I had a similar issue, but in my case diagnostics showed: RemoteHumanReadableError

My fix was to quit Xcode (close window and quit from the menu or use CMD+Q).

Delete contents of:

~/Library/Developer/Xcode/DerivedData/
like image 185
Azim Shaikh Avatar answered Jul 01 '26 14:07

Azim Shaikh


I couldn't fix the issue yesterday but on starting Xcode today it just worked again. It seems to be a bug in Xcode which will hopefully resolved when Xcode 12 is out of the Beta.

To fix the error try restarting Xcode (didn't help me yesterday, but do it anyway) and restarting your Mac.

like image 31
Deitsch Avatar answered Jul 01 '26 15:07

Deitsch