简体   繁体   中英

SwiftUI Canvas: Automatic Preview Updating Paused, Can't resume

I'm working on my app in XCode 13, with a target deployment of iOS 13. I'm trying to implement SwiftUI, but all Canvases refuse to load. If I select Resume, the preview will pause again without ever loading. There are no error messages, the preview just pauses again.

I found a similar question on here, but none of the solutions have worked for me. My account isn't at the level yet where I could leave a comment on it.

So far I have tried the following:

  • Set Enable Previews in build settings to "Yes"
  • Checked off "For install builds only" on all possible items in Build Phases
  • Wrapped build phases scripts in an if statement to check if Previews are enabled
  • Made a clean build, cleared all derived data.
  • Deleted local repository copy and reinstalled from GitHub
  • Restarted computer
  • added #if DEBUG and #endif to preview code
  • Made sure Xcode is not in Legacy Build system.

Other Info:

  • App does not use CoreData, and the previews do not involve API calls.
  • App is rather large, its size might have something to do with it?
  • Xcode will not even show preview for basic "Hello World." default SwiftUI view.

I'm kind of at a loss at this point as to what else to try.

Please let me know if you have any other questions or suggestions.

Creating a new SwiftUI file was the only thing that worked for me. You can delete it again after the preview recompiles.

Take a look at the process SimRenderServer in activity monitor, I think it's this run that Xcode has to relaunch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM