Xcode: Zip files are added to "Link" build phase instead of "Copy Resources"
| Originator: | bewebste | ||
| Number: | rdar://7311680 | Date Originated: | 10-16-2009 |
| Status: | Duplicate/7302929 | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 3.2.1 |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: When adding a .zip file to a target in Xcode, by default Xcode adds the .zip file to the "Link Binaries With Libraries" build phase rather than the "Copy Bundle Resources" build phase Steps to Reproduce: 1. Open up an Xcode project that contains an application target 2. Choose "Add to Project..." from the Project menu 3. In the open panel that comes up, select any file with a .zip extension and click "Add" Expected Results: The .zip file should be added to the target under the "Copy Bundle Resources" build phase, so that it is included in the application bundle when the target is built Actual Results: Xcode instead places the .zip file into the "Link Binaries with Libraries" build phase Regression: The behavior is the same when adding using either "Add to Project" or by drag and drop into the groups and files list, or by checking the checkbox in the "Target Membership" column next to a .zip file that is already in the project. Notes: The .zip file is presumably added to the link phase because precompiled Java classes can sometimes be stored in zip files, so the behavior would make sense when building a Java application. However, this behavior is very confusing when dealing with a non-Java target and makes for a very time consuming debugging process when trying to figure out why the zip file can't be found in your application bundle. If possible, the best behavior would be for Xcode to be able to detect what type of target the zip file is being added to, and only add to the link phase if the target is Java based. If that is difficult or impossible to do, then I would suggest switching the default behavior to add to the "Copy Bundle Resources" phase instead. Given how little Xcode is used for Java development these days relative to other languages, this would make a much better default behavior for the vast majority of Xcode users.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!