Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 659
E. Dn Avatar asked Nov 16 '19 05:11

E. Dn


People also ask

Why is my Mac saying I don't have permission to view files?

On your Mac, select the disk, then choose File > Get Info. Click the arrow next to Sharing & Permissions to expand that section. If the lock at the bottom right is locked , click it to unlock the permissions.


1 Answers

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

like image 165
Tushar Avatar answered Oct 23 '22 03:10

Tushar