6

The file couldn't be opened because you don't have permission to view it

Today I turned on my computer and discovered that all my projects show this error for each file in a project. Some of my projects have third-party libs, some don't. I checked all answers in this question, but none of that helped. Also I tried to reinstall Xcode following this article, it also didn't have an effect.

Of course I tried to reboot my mac and I changed permissions as Xcode asked but it didn't help. As I discovered it is a very common error that can occur for very different reasons. Yesterday everything worked fine, I didn't update macOS or Xcode, but it started getting these errors after turning on the computer.

System: macOS Catalina 10.15.1

Xcode: 11.2.1 (after reinstall, before that Xcode had lower version)

enter image description here

E. Dn
  • 616
  • 7
  • 18

2 Answers2

5

I too had the same file permission issue to my existing project after updating to Catalina.

Resolved it by granting xcode the Full Disk Access. Got to

System Preferences --> Security & Privacy --> Privacy --> Full Disk Access --> Add Xcode & also in Files & Folders --> Add Xcode

Tushar
  • 412
  • 5
  • 11
  • 1
    did not fix the issue on OSX10.15.4/Xcode11.4.1 even after completely rebooting the computer after making the changes above. – Joseph Persie Apr 16 '20 at 08:25
0

Ok that was weird. I have not found a reason why this error occurred, but it's gone after I had created new project. The project was created successfully with all files loaded and after that all old projects started working fine. Tricky Xcode.

E. Dn
  • 616
  • 7
  • 18
  • @coder At the end of the day giving the full permission to the Xcode did the trick (answer above). It's been a while since then though, so can't provide 100% precise details – E. Dn Nov 12 '20 at 10:10
  • I did that it didn't solve the problem, ok thank you – coder Nov 12 '20 at 10:30