Xcode says “You don't have permission” when trying to run

I found many questions on here asking for the same thing. I have tried all of them but I am still getting this error. I created everything from scratch again and was running well until I deleted the data from "DerivedData" folder and now this permissions alert error came back.


I have been trying following things for a week now:

  1. I have tried copying this project to a new folder. Didn't work.
  2. I changed every permission to my folder structure to be read & write to every user.
  3. Product -> Clean.
  4. Renaming the app.
  5. Compiler for C, C++, Objective-C is "Default compiler Apple LLVM 8.0)
  6. Build Settings > Architectures -> to Standard Architectures
  7. Replaced Info.plist from a newly created project.

Xcode version 8.1.

I see that one of the similar questions were tagged as a duplicate. But I am really stuck here for a week. I have tried everything from this answer in the StackOverflow.

And a lot of others that I found online.

I would really appreciate any help on this. I couldn't finish my project because of just this permission issue.

Thank you in advance!

Replies

Stuck with same issue after upgrading to XCode 12.4 and try to build an old project from prior versions
Issue went away after putting "x86_64 armv7s arm64" in VALID_ARCHS for project in 12.4 (12D4e), this is contrary to some posts that suggest VALID_ARCHS should be empty. I went back to the old project and isolate which change I did when migrating the old project to 12.4 that exposed the permission error. The error message and logs are misleading.
Fixed by adding "x86_64 arm64 armv7 armv7s armv6" to my VALID_ARCHS.

I had the same problem. Nothing helped just one thing helped. I copied folder with my project to my flash drive and deleted it from my Mac. After tried it on my flash drive, it worked. Then copied it from my flash drive to my Mac and it worked also.

Any solution to this problem? I stuck in this problem for 2 days :(

I ran into a similar issue only after migrating to a new Mac. For me it appears that Xcode is not giving all of my executables execute permission resulting in the same error. Using 'chmod +x' seems to 'fix' this at least until the next clean/build. I have not yet verified, but it also appears that the affected projects were created using CMake. Otherwise, I have not found the cause.

I do hope this helps someone... Upgraded XCode from an old version to the version that works with El Capitan. Got the same error after messing with the info.plist file. Reverted that file back and still had this new problem when trying to run code in the simulator. The solution for me was to rename the Product Name in Build Settings - I changed a space for an underscore. That didn't work, I then changed it back exactly as it was originally (with a space) and it worked?!?!

For anyone still having permission issues with this ,Here is what I did after trying all day. First since I was moving files from Xcode 12.1 to 14.3 on different machine, it seems to have been permissions issues and pod versions.

So removed all the pods and pod install and it worked .

I got this confusing issue... I resolved this issue by find the "<projetname>.xcodeproj" file in the Finder and open it 🤷‍♂️

  1. open the terminal

  2. go to terminal und made sudo chmod -R 777 public

  3. In Xcode under build setting set sandbox scripting no

voila its buiding and u can testing over the testflight