0

My iOS App cannot run and is throwing the following error "could not read data from '~/FinalProject-Info.plist': The file “FinalProject-Info.plist” couldn’t be opened because there is no such file." Despite the plist being there

Rok Jarc
  • 18,765
  • 9
  • 69
  • 124
dkirlin
  • 315
  • 4
  • 19
  • 1
    @H2CO3: i added xcode tag back because this could very well be an Xcode issue. – Rok Jarc May 05 '13 at 07:52
  • 1
    Select your project in project navigator. Then select your target in main window and select tab "Build Settings". Find a "Info.plist File" entry in Packaging section. Is everything as it is supposed to be? – Rok Jarc May 05 '13 at 07:56
  • No so in my iOS Programming class I have my folder, aptly named finalproject, and in that I have another file called FinalProject, which contains the .xcodeproj and all the .h and .m files as well as .png. It claims that their is another final project folder where it should be located. so finalproj/finalproj/finalproj instead of finalprojfinalproj. I believe this has something to do with the xcodeproj being misplaced in this folder and should not be in here, but one level up. Moving it up one has caused all sorts of havoc though – dkirlin May 05 '13 at 08:09
  • It doesn't matter where your resources are as long as Xcode _knows_ where they are. If you are moving them around in finder then Xcode will lose track of them. You can either move them back to their original location or reimport them (simple drag and drop) to the project. – Rok Jarc May 05 '13 at 08:13
  • OK, thank you, I went through and reimported all my files, and it is claiming clang: error: no such file or directory: '/Users/xxxx/Spring Semester 2013/iOS Programming/FinalProject/FinalProject/FinalProject-Prefix.pch'although I re-imported this file from FinalProject/FinalProject. – dkirlin May 05 '13 at 08:25
  • For some files (info-plist, prefix header...) you also have to set the path in project settings. For prefix header go to the same tab mentioned in my previous comment and find a record "Prefix Header": since you moved the file you will also have to correct the path setting there. – Rok Jarc May 05 '13 at 08:31
  • That seems to have worked, thank you so much! – dkirlin May 05 '13 at 08:46
  • It appears I have spoken to soon, after fixing the syntactical errors with my program I'm now getting a linker error. Undefined symbols for architecture i386: "_OBJC_CLASS_$_AppDelegate", referenced from: objc-class-ref in main.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) Any ideas? – dkirlin May 05 '13 at 08:50
  • There are many possible reasons for this kind of linker error - you'll have to search a bit. Start with: http://stackoverflow.com/q/6984368/653513 – Rok Jarc May 05 '13 at 08:56
  • Aha, i think you only added files to project but not also "to target". You can correct from within Xcode by checking "target membership" box for appropriate files (.m files and most of resource files) – Rok Jarc May 05 '13 at 09:02

2 Answers2

1

Did you try cleaning (CMD+K) the project? Sometimes this helps... Also, try copying the plist somewhere, then delete it from the project directory and Xcode and then add it again (don't forget to check the "copy" option in the dialog box).

Martin Herman
  • 888
  • 13
  • 34
  • I think I found out the error, but now I have a larger problem. For example let's say you have a program "build" it will also have a resource folder named "build". Well my finalproject.xcodeproj ended up inside the Final Project resource folder. So I moved up out of the resource folder and all my files are now listed in red, do I have to somehow fix their directories? – dkirlin May 05 '13 at 08:05
  • 1
    probably the simplest way to fix the directories is creating a new Xcode project and copying all the resources (.h, .m, .xib etc.) over there and reconfiguring everything from scratch... It could take a few minutes to do that but it will fix the issues... – Martin Herman May 05 '13 at 10:12
0

To fix this error I had to delete the simulator files in this path: ~/Library/Developer/Xcode/DerivedData/

Daniel Ryan
  • 6,976
  • 5
  • 45
  • 62