Xcode Preview on real device failed

Hi, when I try to preview any Xcode SwiftUI project on my external device (iPhone 12 iOS 16.1.1) I always get the message:

FailedToTransferItemError: Failed to copy "ContentView.1.preview-thunk.dylib" to device

==================================

|  HumanReadableNSError: The operation couldn’t be completed. (OSStatus error -10814.)

|  

|  NSOSStatusErrorDomain (-10814):

|  ==NSDebugDescription: Unable to find this application extension record in the Launch Services database.

|  ==_LSLine: 685

|  ==_LSFunction: _LSPluginFindWithPlatformInfo

|  

|  ==================================

|  

|  |  MessageSendFailure: Message send failure for transferring ContentView.1.preview-thunk.dylib

Xcode - Version 14.1 (14B47b) This happens with all Xcode projects, even the simple 'Hello World' template. Preview in the Xcode canvas area works fine, also the simulator.

Post not yet marked as solved Up vote post of Nasybullin Down vote post of Nasybullin
1k views

Replies

Hi,

Best next step will be to file a feedback with diagnostics so we can take a look. We will need the diagnostics Xcode Previews generates in order to make sure we understand the error the previews system is encountering.

If you are having issues with macOS, catalyst or on-device iOS previews then download and install the logging profile for your device. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift Attach the sysdiagnose to the bug report as well as the diagnostics using the instructions below.

Then when you get an error in Xcode Previews, an error banner appears in the canvas

  1. Click the "Diagnostics" button in that banner (or if the banner is missing you can use the menu: Editor > Canvas > Diagnostics)
  2. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  3. Attach (or make from the folder) the resulting zip file to the bug (will be named something like previews-diagnostics-0123456789.zip)

Attaching a sample project that you can reproduce the issue with is always helpful too!

I submitted a feedback. Waiting for an answer.

  • What is the feedback ID? I'll track it down and make sure it has been routed to the right team!

  • feedback ID - FB11833309

  • FB11833309

Add a Comment

Feedback ID - FB11833309

Hi, I encounter the problem too. The error is:

FailedToTransferItemError: Failed to copy "ContentView.1.preview-thunk.dylib" to device

==================================

| HumanReadableNSError: The operation couldn’t be completed. (OSStatus error -10814.) |
| NSOSStatusErrorDomain (-10814): | ==_LSFunction: _LSPluginFindWithInfo | ==NSDebugDescription: Unable to find this application extension record in the Launch Services database. | ==_LSLine: 645 |
| ================================== |
| | MessageSendFailure: Message send failure for transferring ContentView.1.preview-thunk.dylib

My device information: iPhone 7 (iOS 15.7.5 19H332) Xcode 14.2 (14C18) Mac mini (M1 2020)

Besides,my iPhone used to be 14.7 before I update it.The preview ran correctly on iOS 14.7

How can I fix the bug?

Thanks!

  • I submit a feedback.The ID is FB12156196

Add a Comment