简体   繁体   中英

plist not copied into the application bundle

I want to copy a plist into my application bundle with Xcode 4.5.2 (or 4.6).

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

When I now compile the project, the my.plist is not copied to the application bundle.I've been trying since hours now.

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

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

Any insight is much appreciated.

EDIT: Thanks for your thoughts! It appears to that there is some strange problem with this project. Any onther (new) project will work as expected here. By changing the extension from 'plist' to 'plis' everything works fine (well, a workaround I know).

  • Go to your Project folder
  • Locate 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's name. If you have the pList away from your project folder, select "Copy items into destination group's folder (if needed)
  • Perform a clean build ( command + shift + K ) and clean build folder ( command + alt + shift + K )
  • Delete your app from Simulator (or Device)
  • Go to your project's targets -> Build phases -> Copy bundle resources -> Click the little "+" in the bottom left corner and make sure your pList is being added there
  • Build and run the project to see if it has been successfully copied

Check the target membership of the file if you have more than one target in your project. If that doesn't do the trick, copy the actual file into your project's directory via Finder and then add it to the project by selecting "add files to..." from within the Xcode project browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM