6

While running my project with swift code in XCode 6.3 & XCode 7, I got this error:

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

My app is not launching anymore. I checked if the compiler setting is right. Executable name & bundle name is also proper.

Cleaned the project couple of times, removed the XCtest target as well.

Lukesivi
  • 2,136
  • 4
  • 23
  • 42
ibiren
  • 581
  • 5
  • 24
  • Refer to this [answer](https://stackoverflow.com/a/50167291/6521116) with a good summary of this issue. – LF00 May 04 '18 at 05:21

5 Answers5

9

This can sometimes be because of a corrupted error in your Info.plist file. Try to create a new project with the same name in Xcode and then replaced the your current projects Info.plist with the new one.

Rashwan L
  • 35,847
  • 7
  • 90
  • 97
3

This can also occur if the source code you are compiling, isn't part of the target you are compiling for. To check this, select some of the source code in your project, then look to the File Inspector (on the right side, Utilities pane) for Target Membership and check that the source code is part of the target.

Aku
  • 794
  • 8
  • 16
  • This was the solution that worked for me. After restructuring my project, each source files' Target Membership had changed (none of the targets were selected) and by reselecting the correct Target Membership in the file inspector the project began building again. – Clay Ellis Oct 19 '17 at 20:50
  • For me, Project > Targets > [target] > App Icons and Launch Images was pulling from an alternate target. – eGanges Feb 21 '19 at 23:48
1

Try:

Entered Bundle name As : ${PRODUCT_NAME}
Changed Executable file : ${EXECUTABLE_NAME}

ΩlostA
  • 2,152
  • 4
  • 19
  • 47
0

Removing the Valid_Archs key in <Build Settings - User Defined> resolved the issue for me.

I couldn't remove the keys in Xcode but opening the project file and deleting using a text editor worked.

Luke
  • 26
  • 5
0

by Choosing Legacy Build System from the workspace setting Solved my problem

File -> Workspace Settings -> Build System: Legacy Build System

Muhammad Numan
  • 12,108
  • 1
  • 25
  • 50