skip to Main Content

My Xcode Version 13.2.1 (13C100) got an unknown issue. I did several things like delete Xcode, new install Xcode, restore from backup nothing make any change! Currently, the project can be built and run in the simulator, but not in the preview window! it gives a message:

Cannot preview in this file - Timed out waiting for connection to DTServiceHub after 15.0 seconds.

What is the issue here any idea?
iMac becomes very slow when I taped the resume button.
Please Help!

enter image description here

7

Answers


  1. Chosen as BEST ANSWER

    Suddenly It fixed, maybe the last update from apple through a software update called "Command Line Tools for Xcode". Before I have also tried a fresh OSX installation but the issue has not gone at all.

    Check Software Update from system preference.
    


    Thanks to the great community.


  2. I had a similar problem and was solved when I turned of Automatically refresh canvas

    enter image description here

    Login or Signup to reply.
  3. Try the following:

    1. Clicking on the "Diagnostics" button on the failed preview pane.

    2. Copy the ".pcm" file path. It looks like something similar to "/var/folders/aa/xxxxxxxxxxxxxxxxxxxxxxx/C/clang/ModuleCache/12345ABCDE/MyTest-XXXXXXXXXXXXXX.pcm"

    3. Run the following command to remove the .pcm file in the Terminal app (replace the path using the specific path you copied from the Diagnostics log obtained in the step above:

      rm -rf /var/folders/aa/xxxxxxxxxxxxxxxxxxxxxxx/C/clang/ModuleCache/12345ABCDE/MyTest-XXXXXXXXXXXXXX.pcm

    References:

    1. https://support.macincloud.com/support/solutions/articles/8000098646
    2. https://developer.apple.com/forums/thread/696908
    Login or Signup to reply.
  4. screenshot

    on a Mac with apple silicon chip

    1. CTRL + Click on Xcode app
    2. Get info
    3. Check "open using Rosetta"
    Login or Signup to reply.
  5. I had the same problem:

    No preview with diagnostic : "Cannot preview in this file – Timed out waiting for connection to DTServiceHub after 15.0 seconds".

    Tried the solutions found on the internet, without success.

    I switched to macOS beta 12.3 and Xcode 13.2.
    And now there is the preview…

    Login or Signup to reply.
  6. The below solution has worked for me:

    Running a preview for a project having scenedelegate or appdelegate which worked and then i tried running preview for app protocol style project which was not working earlier.

    Login or Signup to reply.
  7. For me, it worked when I changed the device to Any iOS Device(Arm 64) for the preview

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search