7

I've downloaded an Open Source Xcode project from GitHub, but I can't open it with Xcode ver 10 or ver 11 beta after updating my Mac to Catalina. I don’t have any problem making a new project though. I've already restarted my Mac few times but there’s no change.

I want some advice.

enter image description here

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Youn
  • 93
  • 1
  • 1
  • 3

7 Answers7

15

[UPDATE: I have now encountered this twice, so I added my second solution.] But spoiler alert...I'm pretty positive the issue stems from saving my Desktop and Documents folders in iCloud


The first time this happened for me, the following steps helped:

It looks like this is an issue related to the new folder permissions in Catalina. When I open System Preferences > Security & Privacy > Privacy > Files and Folders, I see that Xcode appears to have permission to see the pertinent folders. I used VS Code for something else earlier today and it also prompted to ask for access to iCloud Drive. I'm not sure why, but Xcode only shows permission for Desktop and Documents.

How I was able to fix the issue, is that I went to the 'Derived Data' folder for Xcode.

If you're unsure how to do that, here are the steps I did:

  1. Open a different project in Xcode that is saved somewhere besides Desktop or Documents (you could also just create a new project and save it somewhere besides your Desktop or Documents folders).
  2. While in Xcode, go to File > Project Settings.
  3. In the middle of the menu that pops up there is a path to Derived Data with a little ->. Click the ->.See picture here
  4. Send the Derived Data folder to trash.

After doing that, I was able to successfully open all my projects. Hopefully this works for you, but let me know if you have any different experiences or if you get stuck anywhere. Good luck!



I encountered the issue again after updating to beta 5, and doing the above steps did not work for me. I also tried removing my GitHub account, which also didn't help. Here is how I fixed it the second time:

I turned off iCloud Drive in my settings and actually removed everything from my computer from iCloud Drive (for me, it's the Desktop and Documents folders that sync to iCloud). After a while I turned it back on and played with the settings a bit. I then downloaded all the files in my Desktop and Documents folders (from iCloud).

[I'm not sure if this next part was actually part of the solution, but I'm going to just include it anyway since I only noticed it working after I did this...but I suspect that it just took a while for the files to download]

I then turned off permission for Xcode to access the Desktop and Documents folders.

  • I opened System Preferences > Security & Privacy > Privacy
  • I selected "Files and Folders" on the left side. Here you can see all the folders that different apps have access too (Desktop, Documents, Downloads, iCloud Drive).
  • I unchecked every box under Xcode to try and trigger it asking for permission again.

Here is a screenshot for where "Files and Folders" lives: Files and Folders

It didn't ask for permission again, but I forgot about unchecking all the boxes. Then, for some incredibly strange reason...Xcode magically worked again and opened my files. I suspect it was something weird with iCloud and that I finally had downloaded the files I needed for the specific project I've been trying to work on. Later on it wouldn't let me edit the files because I didn't have permission, so I went back to System Preferences and turned on permission for Xcode to access those folders. Everything seems to be in perfect working order now!

eschos24
  • 303
  • 2
  • 10
  • "Files and Folders" doesn't exist on my mac. 10.14.6 – Stephen Phillips Oct 08 '19 at 00:19
  • I updated my answer with a screenshot of where "Files and Folders" is. Keep in mind, this question and my answer are about macOS Catalina (10.15), so this probably does not apply to 10.14.x. – eschos24 Oct 09 '19 at 16:15
  • what about "developer tools" my developer tools shows "terminal" in there and it is disabled and says "allow the apps below to run software locally that does not meet the system's security policy." – aman Dec 03 '19 at 21:27
  • I don't think that is related, @aman. I don't think that should affect anything. My computer has the exact same situation you mentioned (with "Terminal" being unchecked) and everything is working fine for me. – eschos24 Dec 04 '19 at 22:55
  • 1
    So weird, moving a project off my desktop worked for me – Anthony Marino Feb 23 '20 at 06:22
  • Actually, this is an issue related to privacy. Now, Xcode needs to have permission to access files on different locations on your Mac. – Ashutosh Shukla Mar 06 '20 at 04:44
  • 1
    > * It didn't ask for permission again* < you need to use the `tccutil` utility to reset permissions, not just uncheck the box. You only ever get a single prompt unless you reset: https://apple.stackexchange.com/questions/342710/reset-all-mojave-app-permissions – pkamb Mar 07 '20 at 07:17
7

This trick will work in my case, hope it will work for you also.

  • simply go to your project which you want to open, just simply right click on your_project.xcworkspace and go to show Package Contents then deleted the two folder xcsharedata and xcuserdata only(don't worry it will again recreate when you open your xcworkspace again).

  • Now you have to go to your_project.xcodeproj and go to show Package Contents then deleted the folder named xcuserdata only(don't worry it will again recreate when you open your xcworkspace again).

after doing above task you can open your project.

Shamshad
  • 129
  • 1
  • 6
2

Unfortunatelly @eschos24 answer didn't worked for me (macOS Catalina PB4 with Xcode 11 beta). What did worked is remove my Github account from Xcode:

  1. Open Xcode's startup screen (do not open any project yet)
  2. Open Xcode → Preferences → Accounts → Remove the Github account you signed in
  3. Reboot
  4. Open the project via Xcode's startup screens 'Open another project…'

Maybe not every step is neccessary, but these worked for me.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Hordon
  • 603
  • 2
  • 9
  • 21
0

I also faced the same issue. My workaround is restart MacBook.

0

Saw the same on Catalina 10.15.2. Moving my project out of /Users/<Me>/Documents up a directory level, blowing away my DerivedData and restarting XCode worked for me

0

I deleted DeriveData, iOS Device Support, restarted Xcode, restarted computer but not nothing worked. Then I did This and worked for me.

Ved Rauniyar
  • 1,539
  • 14
  • 21
0

Do not save your project in a directory that is syncing with your iCloud account. ie don't put your project on Desktop or Documents. The suggested way to save a project is in a Directory which you need to Create called Developer in your Home directory. ie, /Users/yourName/Developer When you create this directory, it will have a hammer on the folder. This is the proper place to save Xcode projects and you should have no issues opening them if your save them there.

alionthego
  • 8,508
  • 9
  • 52
  • 125