Error while build project Xcode says : "you don't have permission"

IosSwiftIphoneXcode

Ios Problem Overview


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

Ios Solutions


Solution 1 - Ios

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.

Solution 2 - Ios

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.

Solution 3 - Ios

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

Solution 4 - Ios

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.

Solution 5 - Ios

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

Solution 6 - Ios

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

Solution 7 - Ios

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.

Solution 8 - Ios

Clean the project inside Xcode.

Go to Product -> Clean

That worked for me.

Solution 9 - Ios

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

Solution 10 - Ios

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.

Solution 11 - Ios

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.

Solution 12 - Ios

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.

Solution 13 - Ios

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.. :)

Solution 14 - Ios

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

Solution 15 - Ios

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.

Solution 16 - Ios

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

Solution 17 - Ios

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

Solution 18 - Ios

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.

Solution 19 - Ios

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 {

}

Solution 20 - Ios

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.

Solution 21 - Ios

I just Cleaned the project and it worked perfectly.

go to "product" and press "clean"

Solution 22 - Ios

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!

Solution 23 - Ios

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.

Solution 24 - Ios

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.

Solution 25 - Ios

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.

Solution 26 - Ios

I got same problem, when running objective c project in Xcode 12.4 & macOS Big Sur. My screen shot as below. The file

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjogshardikView Question on Stackoverflow
Solution 1 - IosMichael VoznesenskyView Answer on Stackoverflow
Solution 2 - IosjogshardikView Answer on Stackoverflow
Solution 3 - IosAnish Parajuli 웃View Answer on Stackoverflow
Solution 4 - IosSudhin DavisView Answer on Stackoverflow
Solution 5 - Iosvishal dharankarView Answer on Stackoverflow
Solution 6 - IosKakashiView Answer on Stackoverflow
Solution 7 - IosNicolas BuquetView Answer on Stackoverflow
Solution 8 - IosManuel BMView Answer on Stackoverflow
Solution 9 - IosDoraldView Answer on Stackoverflow
Solution 10 - IosnsinvocationView Answer on Stackoverflow
Solution 11 - IosNysView Answer on Stackoverflow
Solution 12 - IosNewStackUserView Answer on Stackoverflow
Solution 13 - IosDheeraj DView Answer on Stackoverflow
Solution 14 - Iosmrunal thankiView Answer on Stackoverflow
Solution 15 - IosAntony RaphelView Answer on Stackoverflow
Solution 16 - Iosuplearned.comView Answer on Stackoverflow
Solution 17 - IosapphipsterView Answer on Stackoverflow
Solution 18 - IosKaruView Answer on Stackoverflow
Solution 19 - IosCasperView Answer on Stackoverflow
Solution 20 - Iosuser1105951View Answer on Stackoverflow
Solution 21 - IosM.EView Answer on Stackoverflow
Solution 22 - IosMostafa Mohamed RaafatView Answer on Stackoverflow
Solution 23 - IosPraveenkumarView Answer on Stackoverflow
Solution 24 - IosKunal ParikhView Answer on Stackoverflow
Solution 25 - Iosarango_86View Answer on Stackoverflow
Solution 26 - IosArshad ShaikView Answer on Stackoverflow