3
votes

I have a project and it works fine. Then I had to make a different version, with the same functions and just need to modify some UI pictures and app name. So I copied the target, made some changes to the target settings, like product name, provisioning profile, preprocessor macros. But when I tried to run it, Xcode show me the dialog: "The file “SecondAppName” couldn’t be opened because you don’t have permission to view it."

I have tried:

  • Repairing permissions using disk utility
  • Cleaning my project
  • Deleting derived data
  • Changing compiler for c/c++/objective-c to Default compiler

But this issue continues to appear. I googled a whole day, but no useful solutions found. Could some one help me? Thanks in advance!

P.S: the original target can run perfectly, the issue only appears on the new target.

2
I tried, but it doesn't make any difference.longbow
Seems I encountered a very rare problem. I almost tried every solution I can find on google, but none helps.longbow
Refer to this answer with a good summary of this issue.LF00

2 Answers

1
votes

I had the very same problem with an app that I built hundred times and suddenly came with this error.

When I performed a project clean the app could build normally but if I tried to rebuild again right after the first build a message saying "The file “iRank Poker Timer” couldn’t be opened because you don’t have permission to view it".

I solved the problem by deleting the second target I've created and duplicate the main target again. Then I edited those files:

  • project.pbxproj
  • iRank Timer copy.xcscheme (That I renamed to "iRank Timer Lite.xcscheme")
  • xcschememanagement.plist
  • iRank Timer copy-Info.plist (That I renamed to "iRank Timer copy-Info.plist")

and replaced all "copy" word occurrences for "Lite".

This completely solved my problem and I never got that annoying message again.

0
votes

The below link has provided multiple options to rename the app name. Pl. check if it can help you How to change the name of an iOS app? we have tried renaming the app name by modifying the bundle identifer and restarting the xcode. it has worked for us without any issue