50
votes

I have downloaded one project from the internet and, when I am trying to run it/build it the XCode, XCode says :

The file “PROJECT NAME” couldn’t be opened because you don’t have permission to view it.

I have also put read/write permission to the project folder as well but still not working.

Why does this is happen? Please help me to resolve this issue

26
try to change the project name and run againDharmesh Kheni
@DharmeshKheni yup already done it but still same issue.jogshardik
Refer to this answer with a good summary of this issue.LF00

26 Answers

60
votes

Go up to the folder containing the project in your Finder.

Right Click > Get Info

Go to the bottom of the Info pane, and click the little lock, type in your password when prompted.

Then, change permissions for yourself to read+write.

Click the little gear below, and apply to all enclosed items.

Close the lock once you are finished!

If this doesn't work, Change the value of "Compiler for C/C++/Objective-C" to "Default Compiler (Apple Clang)" under the Build Settings of your target.

28
votes

The project i have download from the internet don't have the Executable file in info.plist which should be there and its value should be this ${EXECUTABLE_NAME}. Instead of this value it consist some different value. So i have changed it ${EXECUTABLE_NAME} this value then clean->build->run successfully.

21
votes

None of the answers helped me. Although the build was successful i got the error while trying to run the project. Accidentally while cloning the project, there were no files under the Build Phases -> Compile Sources.This might have happened while working on a team in git.

Files under compile sources may be the entry point to be able to build/run the project.

enter image description here

Once i added the AppDelegate & ViewController file in compile sources i was able to run the project without any error.

enter image description here

15
votes

Take your Projects build Setting

In Architecture section make sure that Architectures and Valid Architectures are the same. If any extra Architecture is present in Valid Architecture section please remove it and then try building the code, It will work. enter image description here Here in the image edit the section marked as red.

12
votes

I had similar issue ad problem was there was an info.plist file in one of the folder in framework that i downloaded from GitHub , deleting it fixed the issue

9
votes

I had the same problem. In my case, it caused from I try change display name's app from default to another by edit "Executable file" in Info.plit then compile, it will show this error. So I edit value property "Executable file" as default then edit value property "Bundle name" instead.

enter image description here

7
votes

I had the same error message wit ha project with Xcode 6.1.1.

What I did to resolve it was the following:

  • in Build settings, "Architectures" section: set "Architectures" (ARCHS) to "Standard architectures (armv7, arm64)" for your target and/or project as needed.
  • in Build settings, "Build Options" section: set GCC_VERSION to "Default Compiler (Apple LLVM 6.0)" for project

I was able to launch and test the project with theses settings.

7
votes

Clean the project inside Xcode.

Go to Product -> Clean

That worked for me.

5
votes

Select TARGETS -> General -> Identity -> Version (should be 1.0 or whatever version you want).

5
votes

Doing a Product -> Clean and deleting derived data then rebuilt project worked for me.

The story is that I had 2 projects opened at same time. I've deployed first project on my device and after a while I was trying to deploy second one (initially stopped running first application), then got this ugly error message.

4
votes

Just figured out it can be another problem. It can happen that your Main.m file isn't included anymore in the Build Phases -> compile sources. You'll get the same error. You can just re-add it by clicking the plus and selecting the file from the dialog.

2
votes

Check if Xcode version that you are using is up to date to open the source code. Also check if you have third party libraries, included in it. Check if deployment target, build target etc are up to date in the project settings.

2
votes

Some how my project's Info.plist was missing See Below:

Before:

enter image description here

After:

enter image description here

I have drag and drop the info.plist file path and it worked for me.. :)

2
votes

I have same issue. The problem is with project target membership was removed when I dragged and drop files externally. enter image description here

I added Target membership for it and its working fine for me.

enter image description here

1
votes

I've had same this error in Xcode 8.2. The reason I found out for me, I've included Info.plist from outside project folder (manually copy).

So that Xcode is getting confused for select correct Info.plist.

I just removed that Info.plist from the added library.

Then it is working fine without any permission alert.

1
votes

I deleted a folder that had some header files and plist files from a project I dragged and dropped from. This solved the problem for me. I hope it helps you.

enter image description here

0
votes

I had similar issues with Xcode 7.3:

The file “FirstSteps.temp_caseinsensitive_rename” couldn’t be opened because you don’t have permission to view it.

In my case the solution was to change the Product Name in the Packaging section of the Build Settings:

from "FirstSteps.temp_caseinsensitive_rename" to "FirstSteps"

screenshot

0
votes

I had the same issue but a different cause; answering here for anyone who gets stuck like me in the future.

In my case the issue was that my Xcode project contained no source code directly. All the code, including main(), was being pulled in from an externally-built static library. The solution was to add an empty dummy.cpp file to the project.

0
votes

In my case : xcode menu - product- clean and then build fix the problem.

I imported framework project into another project for some reason I got this error also.

0
votes

I just Cleaned the project and it worked perfectly.

go to "product" and press "clean"

0
votes

Ok, so if any other person facing the same issue on XCode 10, I have fixed it by goin to File->Workspace settings->Build System I made it Legacy build system and it worked!

0
votes

LC 웃 is right on my case. Have deleted the Build Phases -> Copy Bundle Resources build phase which leads this issue. And, adding it back fixed this issue. Also make sure files are present in the build phase.

0
votes

In my case, the cause for this error was different. I had, for some reason removed my AppDelegate's Target Membership from the Application Target. I din't realise that it caused the issue for a long time coz it did work briefly even after I had removed the Target Membership, but later stopped working.

So, make sure you have your AppDelegate set for your Application Target.

@UIApplicationMain // <- THIS
class AppDelegate: UIResponder, UIApplicationDelegate {

}
0
votes

I had the similar issue upon updating my macOS and Xcode (Xcode Version 11.2.1 & Swift 5 ), tried most of the solutions above, but did not seem to work.

However i deleted Xcode and reinstalled it - seems to have resolve the issue.

0
votes

In my case I have Xcode 10.1 & 11 installed to my machine. Not sure whether this will create a problem like this.

I tried all this tips. But didn't solve my issue. Then I tried, manually deleted all files which throws this error and then added it again manually.

Which worked perfectly for me.

0
votes

I got same problem, when running objective c project in Xcode 12.4 & macOS Big Sur. My screen shot as below. The file "" couldn't be opened because you don't have permission

solution as below:

  1. Add "VALID_ARCHS" value "arm64 arm64e armv7 armv7s x86_64" screen shot as below

enter image description here

  1. Change "Build System" to "New Build System" using below steps:
  • Open xcode project
  • Open File -> Project Settings -> Per-User Project Settings: -> Build System: -> "New Build System" -> Done
  1. Add "Excluded Architectures" as "arm64" enter image description here