alpennec
alpennec

Reputation: 2114

Adding an entity to a Core Data model prevent Canvas Preview to show

I have a SwiftUI application with a Core Data model. This model contains some entities, with properties. The canvas is working as expected, showing the preview.

But whenever I add a new entity, event without any property, the canvas fail to show the preview (event a basic view with only a text view in it). The error message is the following:

Cannot preview in this file - The operation couldn't be completed. Transaction failed. Process failed to launch.

I tried to clean my cache, the derived data folder, reset the simulators, etc. When I click on Diagnostics, here is the message:

Error Domain=FBProcessExit Code=4 "The process crashed." UserInfo={NSLocalizedFailureReason=The process crashed., BSErrorCodeDescription=crash, NSUnderlyingError=0x600002f29dd0 {Error Domain=signal Code=4 "SIGILL(4)" UserInfo={NSLocalizedFailureReason=SIGILL(4)}}}

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

BSTransactionError (1): ==error-description: Process failed to launch. ==precipitating-error: Error Domain=FBProcessExit Code=4 "The process crashed." UserInfo={NSLocalizedFailureReason=The process crashed., BSErrorCodeDescription=crash, NSUnderlyingError=0x600002f29dd0 {Error Domain=signal Code=4 "SIGILL(4)" UserInfo={NSLocalizedFailureReason=SIGILL(4)}}} ==NSLocalizedFailureReason: Transaction failed. Process failed to launch. (process launch failed) ==transaction: <FBApplicationProcessLaunchTransaction: 0x60000186d960> ==error-reason: process launch failed

Any idea why I have that?

Thanks, Axel

PS: I'm using Xcode 12 beta 6 (also tried on beta 5). I'm on macOS Big Sur (20A5364e).

Upvotes: 4

Views: 836

Answers (3)

FontFamily
FontFamily

Reputation: 386

The xcrun command above helped me fix this error.

xcrun simctl --set previews delete all

Finding this question / answer via a Google search was difficult as the error message the author had is different than the one XCode 12 generated for my application. Here is my error message in case it helps someone find this question faster via Google.

Error Domain=FBProcessExit Code=4 "The process crashed." UserInfo={NSLocalizedFailureReason=The process crashed., BSErrorCodeDescription=crash, NSUnderlyingError=0x600003ba0a50 {Error Domain=signal Code=4 "SIGILL(4)" UserInfo={NSLocalizedFailureReason=SIGILL(4)}}}

Upvotes: 3

Colin Whooten
Colin Whooten

Reputation: 244

Apple shared this Terminal command with me, which has helped many times by deleting the simulators running previews:

xcrun simctl --set previews delete all

Upvotes: 14

alpennec
alpennec

Reputation: 2114

I fixed my issue with the following steps:

  1. I deleted the preview canvas simulator in: ~/Library/Developer/Xcode/UserData/Previews/Simulator Devices/
  2. I used this command line in Terminal: killall -9 com.apple.CoreSimulator.CoreSimulatorService
  3. I restarted Xcode

The preview canvas probably had the old version of the data model.

Upvotes: 0

Related Questions