Plist is not copied to app bundle

I want to copy plist to my app bundle with Xcode 4.5.2 (or 4.6).

I select my.plist, drag it into the project, and make sure it is also in the Copy Bundle Items under the Build Phases section. Nothing red, everything is fine.

When I compile the project now, my.plist is not copied to the app bundle. I do this with a watch.

If I rename the file to my.png now, pull the file in Xcode, everything is fine - the my.png file is in the app bundle.

So: why isn't the my.plist file copied to the app bundle but the my.png file?

Any insight is greatly appreciated.

EDIT: Thanks for your thoughts! It looks like there is some strange problem in this project. Any new (new) project will work as expected. Changing the extension from "plist" to "plis" everything works fine (well, the workaround I know).

+3


source to share


2 answers


Check target file membership if you have more than one target in your project. If that doesn't do the trick, copy the actual file into your project directory via Finder and then add it to your project by choosing Add Files To ... from the Xcode Project Browser.



0


source


  • Go to your project folder
  • Find your plist
  • Drag it into your project (or right click -> Add Files ... from Xcode)
  • In the window that will be shown, select "Create groups for any added folders" and "Add to targets" → select your target name. If you have a pList in your project folder, select Copy items to target group folder (if needed)
  • Do a clean build ( command+ shift+ K) and clean your build folder ( command+ alt+ shift+ K)
  • Remove app from Simulator (or device)
  • Go to Project Targets -> Build Phases -> Copy Package Resources -> Click the little "+" in the bottom left corner and make sure your pList is added there
  • Build and run the project to make sure it was copied successfully.


+1


source







All Articles