0

I am having a weird problem on Xcode.

I can access and edit all the files in the projects within my workspace except the .xcodeproj files within the project. When I click on such a file, I get an error that says: "The file xxx.xcodeproj could not be opened because you do not have the permission to view it".

However, if I double click it, it will open in a new window. I have made sure that all the permissions are set correct so I cannot figure out why this is happening.

Further, another problem that I think may be related to this is that whenever I open the workspace and try to run a project, it cannot access 'spl.jar' which is a JAR file that is required for my projects to run. However, if I close the workspace. Open the project once through its .xcodeproj file and run it once. Then go back to my workspace and run it through the workspace it will run fine and be able to access the JAR file. All very confusing and honestly if some sys admin can help me out with this, it would be greatly appreciated!

I have looked everywhere for an answer and tried everything that is available online but still am not able to solve it.

************* EDIT *************

Hi Abhinav,

Thanks for providing the solutions, but my problem still stands. I thought I should provide some more details.

If I single-click on the .xcodeproj file, it gives me an error like this:

Single-click

If I double-click on the .xcodeproj file, it will open but I won't be able to edit.

Opens when I double-click the file or go to folder and click on file, but doesn't work when I open through the workspace

Here are my permissions (I am using the Administrator account):

Permissions for .xcodeproj file

Build settings are set to use default compiler:

Compiler Settings

I have tried all your solutions including: Build -> Clean, Delete Derived Data and Restarting my computer.

Its not the worst problem to have because I can still work on my projects. But, I don't understand why this is happening. It is kind of annoying.

philosopher
  • 1,079
  • 2
  • 16
  • 29
  • have you tried this solution http://stackoverflow.com/questions/27355361/error-while-build-project-xcode-says-you-dont-have-permission ? – Badal Shah Oct 02 '15 at 04:57

1 Answers1

0

Try this:

  1. Right click on ".xcodeproj" file, click "Get Info".
  2. Unfold section "Sharing & Permission".
  3. Ensure your login account name is added under "Name" section and that under "Privilege" you have "Read & Write" permissions. If not, then please add it.

EDIT: Post OP comments and studying the matter a bit more, adding some of the common causes of this error and solutions:

Solution 1: Go to Build Settings -> Build Options. Then change the value of Compiler for C/C++/Objective-C to Default Compiler.

Solution 2: In Xcode, go to Window --> Organiser --> Projects --> The app with the issue --> delete button in Derived Data.

Solution 3: In some cases, simple Product -> Clean worked.

Solution 4: Few cases worked with quitting Xcode and restarting the machine.

Abhinav
  • 37,684
  • 43
  • 191
  • 309
  • Thanks Abhinav. I have already done this but to no avail. The user permissions are set correctly. – philosopher Oct 02 '15 at 05:42
  • I see. I am studying this matter beyond my personal experience and could come across few areas that are potential cause for this issue. I've listed them in my post, please check if any of them works for you. Please share your inputs so I could further investigate it :). All the best! @philosopher – Abhinav Oct 02 '15 at 05:53
  • Hey, I added some more details Abhinav. Again, thanks for helping me out! Cheers! – philosopher Oct 03 '15 at 04:00