Xcode 4 + iOS 4.3:“不存在存档类型的打包程序”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5271496/
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
Xcode 4 + iOS 4.3: "No Packager exists for the type of archive"
提问by Elver Loho
I just upgraded to Xcode 4 and am trying to create an adhoc build of an earlier project. Whenever I use the "Archive" option I either end up with no archive at all in the Organizer window OR there is an archive, but there is no option to package it as an .ipa, because "No Packager exists for the type of archive".
我刚刚升级到 Xcode 4 并且正在尝试创建一个早期项目的临时构建。每当我使用“存档”选项时,我要么在管理器窗口中根本没有存档,要么有存档,但没有将其打包为 .ipa 的选项,因为“没有打包器存在于该存档类型”。
Has anyone gotten adhoc builds working under Xcode 4 for project that have been migrated from Xcode 3.2?
有没有人为从 Xcode 3.2 迁移的项目获得了在 Xcode 4 下工作的临时构建?
回答by Lionel Vergé
you may have some linked projects (like librairies) inside your main project. Go to the Build settings of those projects and set the setting "Skip install" (Deployement category) to "Yes", but leave the "Skip install" of the main project to "No". Build, archive, and you should be able to select the ipa package.
您的主项目中可能有一些链接项目(如图书馆)。转到这些项目的构建设置并将设置“跳过安装”(部署类别)设置为“是”,但将主项目的“跳过安装”保留为“否”。构建、归档,然后您应该能够选择 ipa 包。
回答by PixelEdn
Thanks but I needed 3 steps to entierly solve the problem with my project framework:
谢谢,但我需要 3 个步骤来完全解决我的项目框架的问题:
set the Target Build Settings/"Skip Installation" property to "YES" for every dependency project
clear the Target Build Settings "Installation Directory" property for every projects
for every projects, move every headers from section "Build Phases/Build Settings/Copy Headers" Public/Private to Project
将每个依赖项目的目标构建设置/“跳过安装”属性设置为“是”
清除每个项目的目标构建设置“安装目录”属性
对于每个项目,将每个标题从“构建阶段/构建设置/复制标题”公共/私有部分移动到项目
回答by Josh Brown
I found that a combination of these answers solved the problem. I spent a lot of time verifying whether Skip Install was set to Yes on all linked projects and it turned out that was only part of the issue for me. If you're experiencing this issue with Archive, here are the steps to take:
我发现这些答案的组合解决了这个问题。我花了很多时间验证是否在所有链接的项目上都将跳过安装设置为是,结果这只是我的问题的一部分。如果您在使用存档时遇到此问题,请执行以下步骤:
- Find the archive in the Organizer, right-click and select Show in Finder.
- Right-click the .xcarchive file in Finder and select Show Package Contents.
- Find the Products folder and see what's in it. There should only be an Applications folder in the Products folder, and the Applications folder should contain only one iPhone app (YourProject.app).
- 在管理器中找到存档,右键单击并选择在 Finder 中显示。
- 在 Finder 中右键单击 .xcarchive 文件,然后选择“显示包内容”。
- 找到 Products 文件夹,看看里面有什么。Products 文件夹中应该只有一个 Applications 文件夹,Applications 文件夹应该只包含一个 iPhone 应用程序 (YourProject.app)。
If, in step 3, you find a static library (<some-library>.a) either directly under Products or in a subfolder, go to Xcode and select the project that produced the static library (you should be able to tell which project it is based on the name of the static library). Go to the Build Settings and select the target, then set "Skip Install" to "Yes".
如果在第 3 步中,您在 Products 下或子文件夹中找到了一个静态库 (<some-library>.a),请转到 Xcode 并选择生成该静态库的项目(您应该能够分辨出哪个项目它基于静态库的名称)。转到构建设置并选择目标,然后将“跳过安装”设置为“是”。
If, in step 3, you find header files (<some-header>.h) either directly under Products or in a subfolder, go to Xcode and select the project that contains those headers. You should be able to find the project based on the prefix used in the header file names. In that project, go to the Build Phases, and in the Copy Headers section, move all headers from the Public and Private sections to the Project section.
如果在第 3 步中,您直接在 Products 下或子文件夹中找到头文件 (<some-header>.h),请转到 Xcode 并选择包含这些头文件的项目。您应该能够根据头文件名中使用的前缀找到项目。在该项目中,转到 Build Phases,然后在 Copy Headers 部分,将所有标题从 Public 和 Private 部分移到 Project 部分。
Thanks to this answerand this answerand this answerfor helping me to resolve this.
回答by roBman
Here's two other tips that we found useful with this problem...not answers but they may save someone else a LOT of time messing around 8/
这是我们发现对这个问题有用的另外两个技巧......不是答案,但它们可以为其他人节省很多时间 8/
If you're using static libs that are NOT being built by xcode4 then the "deployment->skip install" workaround won't work for them. The work around for that is to NOT add them to the project and make sure their paths are in the Header and/or Library Search Paths in your Build Settings plus the -lblah entries are added to the Linker Flags.
如果您使用的静态库不是由 xcode4 构建的,那么“部署->跳过安装”解决方法对它们不起作用。解决方法是不要将它们添加到项目中,并确保它们的路径位于构建设置中的标题和/或库搜索路径中,并且 -lblah 条目添加到链接器标志中。
Also, if you have a static lib set as a Target Dependency (e.g. we had libjson.a set as this and I'm pretty sure that's the correct/logical thing to do) then you simply won't be able to build .ipa's no matter what. We spent more than a full day dancing around with this stupid problem and in the end just removing this solved it. Personally I think this should really leave a broken project...but it works so meh.
此外,如果您将静态库设置为目标依赖项(例如,我们将 libjson.a 设置为这样,我很确定这是正确/合乎逻辑的事情),那么您将无法构建 .ipa无论。我们花了一整天多的时间来解决这个愚蠢的问题,最后只需删除它就解决了它。我个人认为这真的应该留下一个破碎的项目......但它是如此有效。
回答by Jens Willy Johannsen
In order to figure out what project/library/component that is preventing Xcode from making a proper archive do this:
为了找出阻止 Xcode 制作正确存档的项目/库/组件,请执行以下操作:
Find the archive in the Organizer, right-click and show in finder. This will show an .xcarchive file. Right-click and Show Package Contents. Now look in the Products folder. Most likely there will be more than just an Application folder with one iPhone application inside.
在管理器中找到存档,右键单击并在查找器中显示。这将显示一个 .xcarchive 文件。右键单击并显示包内容。现在查看产品文件夹。很可能不仅仅是一个包含一个 iPhone 应用程序的应用程序文件夹。
In my case there was a usr/local/lib folder structure containing libOAuthConsumer_iPhone.a and when I searched for that in Xcode, I did indeed find another project where I haden't set Skip Install to YES. It may not be so easy for everyone but looking inside the package should at least give you a pointer as to which component is messing up the archive process.
在我的例子中,有一个包含 libOAuthConsumer_iPhone.a 的 usr/local/lib 文件夹结构,当我在 Xcode 中搜索它时,我确实找到了另一个我没有将跳过安装设置为 YES 的项目。这对每个人来说可能都不是那么容易,但是查看包内部至少应该可以让您知道哪个组件正在搞乱存档过程。
回答by IKKA
These are steps to solve above problem in xcode 4.2
这些是在 xcode 4.2 中解决上述问题的步骤
1: " Skip to install" to YES for all third part libraries which are added. "Skip to install" to NO for your project.You can access "Skip to install" from Build settings.
1:对于添加的所有第三方库,“跳过安装”为“是”。对于您的项目,“跳过安装”为 NO。您可以从构建设置访问“跳过安装”。
2:Select your third party library headers from left Navigator pane.
2:从左侧导航器窗格中选择您的第三方库标题。
2.1:On the right is Utililtes pane.Show and hide it with view ->utilities->show/hide utilities (command-Option-0) or with third button in the view segmented control in the toolbar
2.1:右侧是Utililtes面板。使用视图->实用程序->显示/隐藏实用程序(command-Option-0)或工具栏中的视图分段控件中的第三个按钮显示和隐藏它
2.2: select file inspector(command-option-1)
2.2:选择文件检查器(command-option-1)
2.3 choose Target membership and change option to 'Project' from public or private
2.3 选择目标成员资格并将选项从公共或私人更改为“项目”
回答by Diego Marafetti
Skip install didn't work for me. I solved this problem moving all headers marked as public to project. I'm currently working in a workspace with a static lib and an ipad proj. Seems like there is a bug or something with xcode whenever you want to build your product with a linked project, xcode builds both and Organizer doesn't show an option to share an ipa.
跳过安装对我不起作用。我解决了这个问题,将所有标记为 public 的标题移动到项目中。我目前在一个带有静态库和 ipad 项目的工作区中工作。每当您想使用链接项目构建产品时,xcode 似乎都存在错误或其他问题,xcode 会同时构建两者,而 Organizer 没有显示共享 ipa 的选项。