Hi, when I try to preview any Xcode SwiftUI project on my external device (e.g. on iPhone X, iPad Pro) I always get the message:
'Cannot preview in this file - Failed to update preview'.
The App 'Xcode Previews' on the iPhone starts up but the screen stays white. This happens with all Xcode projects, even the simple 'Hello World' template. Preview in the Xcode canvas area works fine, also the simulator. The app can also be installed and runs fine on the iPhone, just the 'Preview on Device does not work. I have tried several Xcode versions (12.3, 12.4 and 12.5 beta), all with the same issue. Have seen the issue reported by others, but no solution yet. Pressing on 'Diagnostics' shows the following report:
RemoteHumanReadableError: Failed to update preview.
Error encountered when sending 'display' message to agent.
==================================
| RemoteHumanReadableError
|
| LoadingError: failed to load library at path "/private/var/mobile/Containers/Data/Application/4F3B9E10-7F01-49EA-B755-3C810ABE9A12//tmp/2FCDE6E3-4B4B-49E4-92F4-1C5156089C36-ContentView.2.preview-thunk.dylib": Optional(dlopen(/private/var/mobile/Containers/Data/Application/4F3B9E10-7F01-49EA-B755-3C810ABE9A12/tmp/2FCDE6E3-4B4B-49E4-92F4-1C5156089C36-ContentView.2.preview-thunk.dylib, 2): no suitable image found. Did find:
| /private/var/mobile/Containers/Data/Application/4F3B9E10-7F01-49EA-B755-3C810ABE9A12/tmp/2FCDE6E3-4B4B-49E4-92F4-1C5156089C36-ContentView.2.preview-thunk.dylib: code signature invalid for '/private/var/mobile/Containers/Data/Application/4F3B9E10-7F01-49EA-B755-3C810ABE9A12/tmp/2FCDE6E3-4B4B-49E4-92F4-1C5156089C36-ContentView.2.preview-thunk.dylib'
| )