Xcode file permission issue - ios

I updated my MacOS to Catalina, after that I am getting error reading issue in one project only. Check below image
When I try to open the file in my xcode, I got below error.
If I opened the same file from finder, then it opens the same file in xcode successfully. And issue is shifted to other file. I tried 7-8 times and it continuously coming from one file to another.
Already tried
Open backup project and still getting same issue.
Tried with changing the folder directory, like copied project to desktop, but still getting issue
Cleaned and build the project,
Restart my mac.
Note: I am getting issue in one project and rest of my projects are working file.
Is there any one time solution for this issue?

This error message can occur (somewhat misleadingly) if Xcode does not have permissions to access your Documents folder, and your project references a file that is not located within the same folder path as the project file.
The error message is misleading because the issue is not "you" (a user) lacking permission to view the file. The issue is that Xcode doesn't have permission to access the location of the file.
To resolve, go to System Preferences, Security & Privacy, Files and Folders, and enable Xcode to access the Documents folder. (Current as of MacOS 10.15.4 and Xcode 11.4.1)

You can change the permission from the Finder, right click on that file, goto info and then on bottom under sharing and permission change the privilege to read and write against your username. This might solve your issue.

Try changing the permission if not already done.
Enter the following in your terminal:
sudo chmod -R 777 /Users/macmini1/Desktop/Classes
It will ask for your password and then you will good to go.

Related

The flutter tool cannot access the file or directory. Unable to grant read/write permissions for the current user

This is the first time I am installing flutter on the mac. I have followed all the steps that are told in flutter.dev. After setting up the path in .zshrc, I get this strange error.
The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has
read/write permissions for the current user.
This is the .zshrc file looks like.
After running flutter doctor getting this.
Thanks in advance.
I encountered this issue when moving my project from windows to a Mac folder. It seems to be an issue with some extended attributes. Using the below command worked for me.
sudo xattr -c -r <project_folder_path>
I'm not sure about this but try it. go to the folder where you installed Flutter, click the folder with to fingers which will show options. got to {Get info} look down at the Sharing & Permission, make sure your current user has read and write.
I just hope this will fix your problem

Info.plist not copied to DerivedData causes compilation error in Xcode

I have a problem that cropped up quite recently with a project that has otherwise compiled and built just fine for over a year.
The error I receive is this:
Showing All Issues
Unable to load contents of file list: '/Users/julian/Library/Developer/Xcode/DerivedData/xxxxxxxxx/Build/Products/Debug-iphoneos/OmataRx.app/Info.plist'
There are a couple of peculiar things here.
First, my Info.plist is not named Info.plist. It is named RxInfo.plist and is indicated as such in the Build Settings Info plist File section.
Second, if I go to this directory path, there are no files there whatsoever. Empty directory. So, whatever build phase was attempting to copy the file there, did not do so. But, there is no error or warning of such a step failing.
Third, if I copy my named plist file to that directory, change the name to Info.plist, everything works fine.
Bonkers, eh?
I've tried a variety of things. I've rebuilt after cleaning, I've deintegrated and then re-installed and re-built the Pods. I've gone to Legacy Build System and attempted that. I had a colleague attempt to build from scratch on their system and they had the precise same error. This all happens on Xcode 11.6. On a whim, I tried building with Xcode 12 beta and had the precise same results.
I'm not sure what to attempt next, to be honest. And dragging-and-dropping and renaming the plist file to that Derived Data directory goes against against everything I believe. 🤣
Suggestions are greatly appreciated!

Sandboxing issue in Xcode Run Script Phase

I have a swift script that reads some files to run some checks on them but I get an error that states: Error Domain=NSCocoaErrorDomain Code=257 “The file “Extensions” couldn’t be opened because you don’t have permission to view it.”
The file exists and has standard permissions, all that has changed is that the script has been compiled on macOS 10.14 instead of macOS 10.13. Also the sandboxing entitlement is not applied to it. Is there any known issue with sandboxing when running a script from a Run Script build phase?
If I simply cat the Extensions file, then it prints the contents out in the log correctly.
Change read/write access to the particular folder.
Please follow this link
macOS User Guide (Apple) -> Change permissions for files, folders or disks on Mac
Or try this
You might try looking in SystemPreferences > Security&Privacy > Privacy tab. From there, scroll down to "Files and Folders" <-- There's where you can see programs and the folders they have been granted access to in Catalina.
Personally, I didn't have time to waste figuring out how the new file permissions are supposed to work, so I let Xcode have full disk permission. (Right above the "files and folders" is "Full Disk Access".

XCode 9....cant open workspace, stuck on Loading

I have this project that I haven't used in a while and since last using it, I have upgraded to Xcode 9 and High Sierra, now I can't open my workspace file :(
This is as far as I get:
And nothing, this project is in an iCloud folder, I have tried taking out of an iCloud folder, removed some folders from my Library folder...still nothing, this is the only recent copy I have for this project and I cant open the xcworkspace file. PLEASE HELP!
UPDATE
I removed contents.xcworkspacedata from my workspace Contents folder and removed project.xcworkspace from my xcodeproj file Content folder and now I am able to open the project, but it says no files when there is, I can open the xcodeproj file and the files are there, also I have no Schemes either.
I had similar problem, I fixed by turning off my wifi, then open my project and turning on my wifi again. iCloud sync was the problem.

Xcode build process stuck at "Copying swiftdocs"

Creating a build for my Xcode project takes too much time. It gets stuck at "Copying swiftdocs". I am making a build to run on device. I cant understand why this is happening. No relevant info available on internet. Just for the info, I am using Cocoa Pods in the project.
Is it anywhere related to pods? I am unable to run the app on device.
Xcode stuck indexing error (compiling model, copying swiftdocs, etc.)
Open your Project Folder.
Find ProjectName.xcodeproj file.
Right-Click Copy and Paste to Safe Place.
Right-Click Show Package Contents.
Find project.xcworkspace file and delete that file.
Reopen Your Project and clean and Rebuild.
If your problem is not solved then replace the file with your backup file.
Hope this will work for you. If still not restart your mac some time it works with restart.

Resources