2

After updating to Xcode 26, I’m no longer able to load SwiftUI previews in new projects. The preview pane shows the error:

Cannot preview in this file.

Interestingly, if I disable “Automatically Refresh Canvas”, the preview works again. It also works in older projects (created in Xcode 16.4) even when “Automatically Refresh Canvas” is turned on. Xcode 26 – disable "Automatically Refresh Canvas" in the SwiftUI preview

Has anyone encountered this issue or knows why it happens?

For context:

  • I keep the Derived Data folder inside my project folder.
  • The issue only affects new projects created after the Xcode update.

That's the preview's error:

== DATE:

    Saturday, 8 November 2025 at 08:33:23 Central European Standard Time
    
    2025-11-08T07:33:23Z



== PREVIEW UPDATE ERROR:

    GroupRecordingError
    
    Error encountered during update group #2
    
    ==================================
    
    |  FailedToLaunchAppError: Failed to launch com.<name>.DemoApp
    |  
    |  ==================================
    |  
    |  |  [Remote] JITError
    |  |  
    |  |  ==================================
    |  |  
    |  |  |  [Remote] CouldNotLoadInputObjectFile: Could not load object file during preview: /Users/<name>/Documents/DemoApp/DerivedData/DemoApp/Build/Intermediates.noindex/DemoApp.build/Debug-iphonesimulator/DemoApp.build/Objects-normal/arm64/ContentView.1.preview-thunk-launch.o
    |  |  |  
    |  |  |  path: /Users/<name>/Documents/DemoApp/DerivedData/DemoApp/Build/Intermediates.noindex/DemoApp.build/Debug-iphonesimulator/DemoApp.build/Objects-normal/arm64/ContentView.1.preview-thunk-launch.o
    |  |  |  
    |  |  |  ==================================
    |  |  |  
    |  |  |  |  [Remote] XOJITError
    |  |  |  |  
    |  |  |  |  XOJITError: '/Users/<name>/Documents/DemoApp/DerivedData/DemoApp/Build/Intermediates.noindex/DemoApp.build/Debug-iphonesimulator/DemoApp.build/Objects-normal/arm64/ContentView.1.preview-thunk-launch.o': Operation not permitted



== PREVIEW UPDATE ERROR:

    GroupRecordingError
    
    Error encountered during update group #2
    
    ==================================
    
    |  FailedToLaunchAppError: Failed to launch com.<name>.DemoApp
    |  
    |  ==================================
    |  
    |  |  [Remote] JITError
    |  |  
    |  |  ==================================
    |  |  
    |  |  |  [Remote] CouldNotLoadInputObjectFile: Could not load object file during preview: /Users/<name>/Documents/DemoApp/DerivedData/DemoApp/Build/Intermediates.noindex/DemoApp.build/Debug-iphonesimulator/DemoApp.build/Objects-normal/arm64/ContentView.1.preview-thunk-launch.o
    |  |  |  
    |  |  |  path: /Users/<name>/Documents/DemoApp/DerivedData/DemoApp/Build/Intermediates.noindex/DemoApp.build/Debug-iphonesimulator/DemoApp.build/Objects-normal/arm64/ContentView.1.preview-thunk-launch.o
    |  |  |  
    |  |  |  ==================================
    |  |  |  
    |  |  |  |  [Remote] XOJITError
    |  |  |  |  
    |  |  |  |  XOJITError: '/Users/<name>/Documents/DemoApp/DerivedData/DemoApp/Build/Intermediates.noindex/DemoApp.build/Debug-iphonesimulator/DemoApp.build/Objects-normal/arm64/ContentView.1.preview-thunk-launch.o': Operation not permitted
4
  • "Operation not permitted" is some sort of permission error. A quick Google suggests it might be to do with Xcode not having access to some part of the folder tree. Commented Nov 8 at 12:04
  • Have you tried closing XCode, trashing the DerivedData folder then Clean Build Folder when launching Xcode again before enabling the Preview? Commented Nov 8 at 15:42
  • Yes, I have. I even deleted the xcode caches. Nothing helps. It's weird because it works fine for the project I created in xcode 16.4. The issue occurs for a projects created in xcode 26.01 and 26.1. Commented Nov 8 at 18:22
  • Ok — I found the issue. My project was in the “Documents” folder, which is part of macOS’s secure area. I moved it somewhere else, and that fixed it. Commented Nov 8 at 18:34

1 Answer 1

0

The same code worked on iOS, but failed on MacOS, no meaningful log to support me debugging this (newbie to Apple development)

When I unchecked this "Edit > Canvas > Automatically Refresh Canvas", mac worked.

Hopefully it will be fixed in future XCode versions.

Thanks for the post.

BTW: The Canvas options sometimes disappears for no reason, and when I close XCode, this option is turned ON by default for some reason.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.