reports icon indicating copy to clipboard operation
reports copied to clipboard

FB13480883: PreviewShell hangs when attempting to preview a Live Activity in the Dynamic Island

Open insidegui opened this issue 2 years ago • 0 comments

  • Date: 2023-12-20
  • Resolution: Open
  • Area: Xcode
  • OS: 14.3 Beta (23D5033f)
  • Type: Incorrect/Unexpected Behavior
  • Keywords: xcode,swiftui,previews

Details

What version of Xcode are you using?

Version 15.2 beta (15C5500c)

Did you see an error message?

Yes

What was the error?

Failed to launch app ”...” in reasonable time

What devices were you using when the issue occurred?

Mac

Description

If I have a widget extension that defines a Live Activity and attempt to preview using the Dynamic Island presentation context, the Xcode preview fails to update and PreviewShell can be seen using 100% CPU until it is force-quit in Activity Monitor.

To reproduce:

  • Create an iOS app with a widget extension, making sure to include a Live Activity widget
  • Duplicate the existing #Preview block at the bottom of the template Swift file, replacing “as: .content” with a Dynamic Island presentation mode, like “as: .dynamicIsland(.compact)”
  • Select the new Dynamic Island preview in the Canvas
  • With the preview active, modify something inside the widget implementation

Expected: the preview should update Actual: the preview never updates and PreviewShell hangs with 100% CPU usage, resulting in a ‘Failed to launch app ”...” in reasonable time’ error message

Files

Sample of PreviewShell.txt

insidegui avatar Dec 20 '23 15:12 insidegui