在 Xcode 中归档项目错误地创建了多应用程序包
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5206536/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Archiving project in Xcode incorrectly creates multi-application bundle
提问by Jared Friedman
Archiving my project in Xcode is creating a multi-application bundle, instead of bundling my main target for release, which is what I want. Specifically, when I validate my archive in Organizer, it gives me the message:
在 Xcode 中归档我的项目是创建一个多应用程序包,而不是捆绑我的主要发布目标,这正是我想要的。具体来说,当我在 Organizer 中验证我的档案时,它给了我以下信息:
"[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."
“[projectname] 不包含单捆绑应用程序或包含多个产品。请选择另一个存档,或调整您的方案以创建单捆绑应用程序。”
It sounds like there is some setting in the scheme that needs to be adjusted, but I can't figure out what's causing other targets to be included.
听起来方案中有一些设置需要调整,但我无法弄清楚是什么导致其他目标被包括在内。
I'm using Xcode 4.0 by the way.
顺便说一下,我正在使用 Xcode 4.0。
回答by 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.
好的,回答我自己的问题。事实证明这是 XCode 4 中依赖项目的问题。如果发生这种情况,请检查所有依赖项目(例如静态库)的构建设置,并确保设置了“部署”下的“跳过安装”选项是。
More detail here: http://flakasoft.com/developer-tips/xcode-4-bug-solution-for-archiving-build-with-static-library/
更多细节在这里:http: //flakasoft.com/developer-tips/xcode-4-bug-solution-for-archiving-build-with-static-library/
回答by Ryan Grimm
Two things needed to be fixed in the sub-project(s) to resolve this issue:
要解决此问题,需要在子项目中修复两件事:
- As Jared discovered, under the Build Settings, set the "Skip Install" to "Yes"
- 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.
- 正如贾里德发现的那样,在构建设置下,将“跳过安装”设置为“是”
- 在 Build Phases 下,检查 Copy Headers 部分。如果有任何头文件列为 Private 或 Public,请将它们向下拖到 Project 部分。
回答by abbood
I did the following to make it work for me:
我做了以下工作以使其对我有用:
- for the three20 static library, I used cocoapodsto 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.
- 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
- most importantly:under the sub libraries.. under build phases i ensured that copy filesdestination was changed from
Absolute path
toproducts directory
.
- 对于three20静态库,我使用cocoapods将文件包含在主项目中..它刚刚摆脱了three20给我带来的所有麻烦(而且它们很多..)顺便说一句,我尝试用Nimbus替换three20 ..但是Nimbus缺少我的项目使用 Three20 的某些功能......所以 Nimbus 没有帮助。
- 在所有其他子项目/静态库的构建设置下将跳过安装设置为是,并在构建阶段将复制头从公共切换到项目
- 最重要的是:在子库下.. 在构建阶段下,我确保复制文件的目的地从 更改
Absolute path
为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:
提示:要了解导致存档创建存档文件而不是 ipa 的违规文件,请执行以下操作:
- Select the archive and click the Distribute button.
- Select the 'Save Built Products' option.
- Hit Next and Save.
- Browse the created directory in Finder.
- The 'libraries' subdirectory will identify the libraries that you need to set the Skip Install to Yes.
- 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
- 选择存档并单击分发按钮。
- 选择“保存构建的产品”选项。
- 点击下一步并保存。
- 在 Finder 中浏览创建的目录。
- 'libraries' 子目录将标识您需要将跳过安装设置为是的库。
- 在某些情况下,
usr/local/include
将识别您需要从 Public 移动到 Project 或您必须从绝对路径更改为 products 目录的罪魁祸首头文件。但该目录(即 usr/local/include)因您的子库目录结构而异
回答by auco
I had a copy files build phase I forgot about (copied some fonts into ~/Library/Fonts). After removing this build phase, it worked fine.
我有一个我忘记的复制文件构建阶段(将一些字体复制到 ~/Library/Fonts)。删除此构建阶段后,它工作正常。
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.
如果以上答案都不能解决问题,我建议将存档导出到查找器并查看 .app 包之外的内容。
Edit: see https://github.com/RestKit/RestKit/wiki/Xcode-4-Archiving-Issue:--'Does-not-contain-a-single-bundle'
编辑:见https://github.com/RestKit/RestKit/wiki/Xcode-4-Archiving-Issue:--'Does-not-contain-a-single-bundle'
回答by roocell
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.
我也有同样的问题“[projectname] 不包含单捆绑应用程序或包含多个产品。请选择另一个存档,或调整您的方案以创建单捆绑应用程序。” 升级到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.
问题是我的“发布”构建设置中的一堆字段是空白的。我猜xcode4自动切换到调试设置。
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.
anwyays - 我的解决方法是找到所有那些空白的“发布”设置并将它们设置为调试设置。特别是 Info.plist 文件设置。