Archiving project in Xcode incorrectly creates multi-application bundle

北慕城南 提交于 2019-11-26 19:17:55
Jared Friedman

OK, answering my own question. Turns out it is an issue with dependent projects in XCode 4. If this happens to you, go through the Build Settings for all your dependent projects (e.g. static libraries) and make sure that the "Skip Install" option under "Deployment" is set to YES.

More detail here: http://flakasoft.com/developer-tips/xcode-4-bug-solution-for-archiving-build-with-static-library/

Ryan Grimm

Two things needed to be fixed in the sub-project(s) to resolve this issue:

  1. As Jared discovered, under the Build Settings, set the "Skip Install" to "Yes"
  2. Under the Build Phases, examine the Copy Headers section. If there are any header files listed as Private or Public, drag them down to the Project section.

I did the following to make it work for me:

  1. for the three20 static library, I used cocoapods to include the files within the main project.. it just got rid of all the trouble three20 was giving me (and they are lots..) btw i tried replacing three20 with Nimbus.. but Nimbus was lacking on some of the features that my project was using three20 for.. so Nimbus wasn't helpful.
  2. set skip install to yes under build settings for all other sub projects/static libraries and switched the copy headers from public to project under build phases
  3. most importantly: under the sub libraries.. under build phases i ensured that copy files destination was changed from Absolute path to products directory.

and that was it!

hint: to get an idea of the offending files that's causing your archive to create an archive file rather than an ipa do this:

  1. Select the archive and click the Distribute button.
  2. Select the 'Save Built Products' option.
  3. Hit Next and Save.
  4. Browse the created directory in Finder.
  5. The 'libraries' subdirectory will identify the libraries that you need to set the Skip Install to Yes.
  6. in some cases usr/local/include will identify the culprit header files you need to move from Public to Project or the files that you have to change from absolute path to products directory. but that directory (ie usr/local/include) varies depending on your sublibrary directory structure

I had a copy files build phase I forgot about (copied some fonts into ~/Library/Fonts). After removing this build phase, it worked fine.

If none of the above answers fix the issue, I recommend exporting the archive to the finder and taking a look what's outside the .app bundle.

Edit: see https://github.com/RestKit/RestKit/wiki/Xcode-4-Archiving-Issue:--'Does-not-contain-a-single-bundle'

i also had this same problem "[projectname] does not contain a single–bundle application or contains multiple products. Please select another archive, or adjust your scheme to create a single–bundle application." after upgrading to xcode5.

the problem was that a bunch of fields in my build settings for 'release' were blank. I guess xcode4 automatically switched to the debug setting.

anwyays - my fix was to find all those 'release' settings that were blank and set them to the debug setting. In particular it was the Info.plist file setting.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!