NSCocoaErrorDomain when trying to run

I have been struggling with this error. My build succeeds but won't run. I've tried every suggestion I've ready in every article I could find and nothing has worked. This happens if I run it on the simulator or device. Any tips?

==============================

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

Domain: NSCocoaErrorDomain

Code: 257

Failure Reason: You don’t have permission.

Recovery Suggestion: To view or change permissions, select the item in the Finder and choose File > Get Info.

User Info: {

    NSFilePath = "/Users/Me/Library/Developer/Xcode/DerivedData/Main-ekzzcailcbrpykazzxdtbnpsjuhr/Build/Products/Debug-iphoneos/APP NAME.app";

}
  • -

The operation couldn’t be completed. Permission denied

Domain: NSPOSIXErrorDomain

Code: 13

Failure Reason: Permission denied

Replies

I'm facing the exact same problem with the application I'm working on. Have tried clean up the build folder also check the permission settings for then DerivedData folder but no result.

Build succeeds but get the below error

Details:


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

Domain: NSCocoaErrorDomain

Code: 257

Failure Reason: You don’t have permission.

Recovery Suggestion: To view or change permissions, select the item in the Finder and choose File > Get Info.

User Info: {

    NSFilePath = "/Users/sysuser/Library/Developer/Xcode/DerivedData/myapp-aylojruwzhsbrrbwomkiwefxqlxv/Build/Products/Debug-iphonesimulator/myapp.app";

}
  • -

The operation couldn’t be completed. Permission denied

Domain: NSPOSIXErrorDomain

Code: 13

Failure Reason: Permission denied
  • -


System Information

macOS Version 10.15.7 (Build 19H114)

Xcode 12.4 (17801) (Build 12D4e)


Please if someone can help resolve this issue?