I have a project that will not archive correctly in Xcode 4. It seems to me that the Build For Archiving and Archive commands are built differently, and I canβt determine why!
More details:
- The workspace contains two projects: an application and a static library; projects are organized as peers.
- "Build" and "Run" are working fine; the application runs in the iOS simulator and on the device.
- Build for Running, Build for Testing, Build for Profiling, and Build for Archiving all work correctly.
- Build to run - debugging, build to profile - release, so both configurations have been tested.
- "Archive" does not work!
Failure 1 (Library):
When I try to execute the Archive command in the library, the user-defined resource script fails. script read from resource directory ($ RESOURCES_DIR)
For release versions, this maps to:
... DerivedData / App-uniquecrap / Build / Products / Releases-iphoneos / Resources / LibraryName
For the archive, this maps to:
... DerivedData / App-uniquecrap / ArchiveIntermediates / Build Frameworks / BuildProductsPath / Release-iphoneos / Resources / LibraryName
Except Resources missing in the ArchiveIntermediates tree!
UPDATE: The first part of the problem is caused by poor quoting in the script file. The Xcode4 path now includes a folder with built-in space (imagine that!) And incorrectly quotes paths that do not work as we would like. This is fixed, I still have a problem that the resource files copied during the build phase of Gather Resources will not be in the right place; The script expects them at $ (RESOURCE_DIR), but I cannot find the correct setting in Gather Resources to send them there. Suggestions?
Failure 2 (application):
When I was able to compromise my path, the first crash (usually by copying files and bypassing the script), I encountered another error creating the application. Archive complains that it cannot find imported files when creating precompiled headers.
Nothing unusual here; headers are imported into the pch file in the usual way:
#import <LibraryName/Library.h>
As before, "Build", "Build for Archiving", etc. no problem. The archive fails. Either the included paths are configured correctly, and the Archive ignores them; or included paths are configured incorrectly, and Xcode automatically configures them in other assemblies. (Anyway, I'm very upset).
How can I (A) do archive assemblies; or (B) find out what is happening, so can I do (A)?
Thanks.