Reputation: 485
After cloning my Github repo, everything runs fine except the build fails because of this error "Reading data: The file "Info.plist" couldn't be opened because there is no such file."
I have tried every possible solution I could find, including deleting the file and creating a new one, deleting it from the Copy Bundle Resources, adding it to the Build Settings, etc. I have followed these posts among others on all of the solutions but nothing has worked. Error: The file “Info.plist” couldn’t be opened because there is no such file, Info.plist Utility Error: "Info.plist couldn't be opened because there is no such file"
I would really appreciate someone's help in finding a solution to this problem, and if you need any more information, please let me know.
Edit: Also for some reason when I looked in the project it's not the newest version that I had committed to Github. I was wondering how I can clone an exact commit? I was trying to look at this post but I'm not exactly sure where to find the remote address?
Upvotes: 4
Views: 3220
Reputation: 47302
The following applies to the question, comments and answers here:
Info.plist
should be capitalized — if not it could easily explain your problem.
NOTE: Several comments and answers are using lowercase
, this just adds fuel to the fire. It's best to be specific (especially when it comes to this), because that minor detail can make a huge difference.info.plist
The answer awarded the bounty is absolutely false information. The following excerpt comes directly from the documentation previously linked:
Important: In the sections that follow, pay attention to the capitalization of files and directories that reside inside a bundle. The NSBundle class and Core Foundation bundle functions consider case when searching for resources inside a bundle directory. Case mismatches could prevent you from finding your resources at runtime.
Upvotes: 1
Reputation: 258601
Update: Although it is not important how the info plist file is named physically in your project, because Xcode renames it always into Info.plist during product bundle creation phase, but to avoid confusing among community, let's assume that your info plist is named Info.plist.
Check the followings:
1) Is Info.plist present in file system after clone?
2) Is correct related path is set for Info.plist in project Build Settings (INFOPLIST_FILE
tag)?
3) Is Info.plist file not damaged - opened by Xcode as a document (Info tab in project settings should show it as well)?
Note: Info.plist should not be added in target's Resources, it is copied by Xcode from mentioned above INFOPLIST_FILE
(and renamed if needed into Info.plist!)
Upvotes: 1
Reputation: 9251
It's going to be pretty difficult to debug this without having a look at your project, if all fails you might consider making a copy, remove all source files and share that shallow copy on a public repo.
Otherwise, on top of what @Asperi had already said, be sure to:
ProcessInfoPlistFile
. Check if there's something wired with the path there, check if the file pointed by that path is missing, if it has the right project name etc.plist
, not just the main one.yourprojectname.xcodeproj/project.pbxproj
in a plain text editor (e.g. write open yourprojectname.xcodeproj/project.pbxproj
in terminal) and search for Info.plist
, be sure that each entry has a valid path (the path specified there actually exists)Upvotes: 1