xcode continues project loading forever
Asked Answered
D

7

8

I have a source code of a swift application which developed for iOS using swift 3.

I want to run it inside Xcode however it remains in loading state forever. I have tried solutions provided in question Xcode freezes on startup while loading project however the situation did not change.

The developer of this source code told me that he used Xcode 9.x to develop application so he suggested me to try a 9.x version of Xcode. I guess Xcode should be backward compatible however I want to know does using Xcode 9.x changes the situation or I should look for reason somewhere else?

Danley answered 22/4, 2019 at 10:4 Comment(0)
D
20

Using answer in apple.stackexchange.com did the trick:

Removing the ~/Library/Saved Application State/com.apple.dt.Xcode.savedState/directory might help.

Danley answered 22/4, 2019 at 10:24 Comment(0)
B
12

I tried all the solutions outlined here and none of them worked. However, I managed to fix this issue and here is what worked for me: If you're on an Apple OS and have iCloud sync enabled on your desktop/documents/any folder where you're loading Xcode from, the iCloud sync could be causing this issue.

I installed a fresh copy of my RN project in a directory not synced by iCloud and subsequently the issue was resolved; my build-time was down to a couple of seconds!

Barsac answered 5/5, 2020 at 3:8 Comment(2)
this worrked for me as well but is there a Long term solution for this. I would like to keep my projects synced to iCloudLatarsha
oh my god thank you so much!!! Lost many hours to this, all you have to do is add .nosync to the end of your folder name, and it was instantaneous! (like in this article: cntechpost.com/2020/03/28/…)Despumate
H
8
rm -rf ~/Library/Developer/xcode

in terminal worked for me, based on this answer

Hobnob answered 13/8, 2020 at 8:44 Comment(2)
Please note that this will also remove the UserData folder which contains your settings, themes, code snippets, changes to keyboard shortcuts, etc. Maybe something more targeted would be preferable.Instability
@Pomme2Poule you have a point, I would like to know a better solution though. XC is just pain sometimes and there's nothing you can do except hard resetHobnob
C
4

As of July, 2022, nothing else worked for me but, taking my project outside of the iCloud Drive and putting it into a directory without it. As it is mentioned above, iCloud sync interferes with the XCode running and stalls it.

Cacogenics answered 19/7, 2022 at 11:8 Comment(1)
it's taking eternity to copy into another folder. How did you manage to move the files ?Anthropophagi
M
2

My xcode got hang when I force quit it. After that it was showing only "loading". Here is fix to start xcode from beginning.

cd /  
cd Applications
cd Xcode.app
cd Contents/MacOS
sudo ./Xcode

it will open xcode default window to open a new project.

Moulden answered 26/11, 2022 at 8:59 Comment(0)
O
2

I wasted almost 2 hrs and tried everything on stack over flow

SIMPLE SOLUTION

Just turn OFF icloud from your mac os so that it it will not sync the project.

To turn off icloud

  1. Go to setting
  2. Icloud
  3. turn off sync

Thats all enjoy

Olivares answered 24/1, 2023 at 13:19 Comment(1)
It worked for me! It was exactly this! Thank you!Sextillion
P
0

I tried to delete:

~/Library/Developer/Caches/com.apple.dt.Xcode
~/Library/Developer/Xcode/DerivedData
~/Library/Developer/Saved Application State/com.apple.dt.Xcode.savedState
~/workspace/MyProject.xcodeproj/project.xcworkspace/xcuserdata

and once it helped. But another time it didn't help, so I also tried to reinstall Xcode, which also didn't help.

It turned out that the problem was that I was installing the app via WiFi or Bluetooth. When I connected my device via cable, the Xcode popped up to life and the "loading forever" stopped.

Packing answered 13/3, 2021 at 12:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.