在 Xcode 6 中使用 iOS 8 扩展归档应用程序期间的警告

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25949108/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:38:14  来源:igfitidea点击:

Warning during archive App with iOS 8 Extension in Xcode 6

iosobjective-cxcodeios8ios-app-extension

提问by Gianpispi

I have a problem while archiving my app.

归档我的应用程序时遇到问题。

I created a new target for an iOS 8 extension.

我为 iOS 8 扩展创建了一个新目标。

When I archive the app, I receive a warning.

当我归档应用程序时,我收到一条警告。

The warning is

警告是

"PBXCp Warning", "warning: skipping copy phase strip, binary is code signed: /Users/Library/Developer/Xcode/DerivedData/App/Build/Intermediates/ArchiveInter mediates/AppName/IntermediateBuildFilesPath/UninstalledProducts/AppExtappex/AppE xt"

“PBXCp 警告”,“警告:跳过复制阶段条,二进制代码签名:/Users/Library/Developer/Xcode/DerivedData/App/Build/Intermediates/ArchiveInter mediates/AppName/IntermediateBuildFilesPath/UninstalledProducts/AppExtappex/AppE xt”

The app is in Objective-C.

该应用程序在 Objective-C 中。

采纳答案by perezda

Check the "Strip Debug Symbols During Copy" option in your Xcode target's build settings. Its saying that it cant strip debug symbols because the extension was already signed.

检查 Xcode 目标的构建设置中的“在复制期间剥离调试符号”选项。它说它不能剥离调试符号,因为扩展已经签名。

回答by Collin

If you create a brand new sample project and a Today Extension in Xcode 6.2, the default values are set to NO for stripping of debug symbols.

如果您在 Xcode 6.2 中创建一个全新的示例项目和 Today Extension,默认值设置为 NO 以去除调试符号。

enter image description here

在此处输入图片说明

回答by Luis Ascorbe

Copied from: https://stackoverflow.com/a/30459703/736384

复制自:https: //stackoverflow.com/a/30459703/736384

"Compiled code usually contains debug information. This debug stuff is helpful for inspecting running code in debugger, but less so for the optimized code you would ship in distribution builds. Therefore it gets stripped out when doing an Archive build.

The problem here is that PBXCp is unable to strip out debug symbols from signed binaries because this would invalidate the digital signature. So if you have a project that was created before Xcode 6.3 you will now get a warning like this.

To fix the warning simply change both values to NO. Removing them does not work because the default value is still YES for both. The project templates that came with Xcode 6.3 have these turned off by default. Only projects that were started with older templates still have YES on the Release line."

Source:https://www.cocoanetics.com/2015/04/skipping-copy-phase-strip/

“编译后的代码通常包含调试信息。这些调试内容有助于在调试器中检查正在运行的代码,但对于您将在分发版本中发布的优化代码则不太有用。因此,在进行存档构建时,它会被删除。

这里的问题是 PBXCp 无法从签名的二进制文件中去除调试符号,因为这会使数字签名无效。因此,如果您有一个在 Xcode 6.3 之前创建的项目,您现在将收到这样的警告。

要修复警告,只需将两个值更改为 NO。删除它们不起作用,因为两者的默认值仍然是 YES。默认情况下,Xcode 6.3 附带的项目模板已关闭这些功能。只有使用旧模板开始的项目在发布行上仍然有 YES。”

来源:https : //www.cocoanetics.com/2015/04/skiping-copy-phase-strip/

回答by Monstieur

The framework / extension is already stripped and code signed by default. The application project cannot detect that the framework has already been stripped and throws a harmless warning. You should notdisable it or your application will not be stripped.

默认情况下,框架/扩展已经被剥离和代码签名。应用项目无法检测到框架已经被剥离并抛出无害警告。你应该不是禁用它或者你的申请将不被剥离。

回答by Mark Edington

There seems to be some confusion surrounding the effect of the Strip Debug Symbols During Copybuild setting, I recommend reading this article for additional information: Skipping Copy Phase Strip.

在复制构建设置期间条带调试符号的效果似乎有些混乱,我建议阅读这篇文章以获取更多信息:Skipping Copy Phase Strip

Here are my key takeaways from researching this question:

以下是我研究这个问题的主要收获:

  • When you create a new project with Xcode 6.2 or later the values inserted into the project file are NOfor both of the default build configurations (Debug and Release) for this setting.
  • Setting the value to YESin the Release configuration and the performing a Product Archive has no effect on the generated application binary size (I encourage you to verify this through a test on your own projects).
  • Debug symbols used for Sybolication of iOS crash reportscome from an external .dsym file which is separate from the application bundle so I would not expect the symbol table to be included in the binary.
  • 当您使用 Xcode 6.2 或更高版本创建新项目时,对于此设置的两个默认构建配置(调试和发布),插入到项目文件中的值都是NO
  • 在 Release 配置中将该值设置为YES并执行 Product Archive 对生成的应用程序二进制大小没有影响(我鼓励您通过对自己的项目进行测试来验证这一点)。
  • 用于iOS 崩溃报告 Sybolication 的调试符号来自外部 .dsym 文件,该文件与应用程序包分开,因此我不希望符号表包含在二进制文件中。

回答by ehrpaulhardt

In the "Deployment" section in your target′s build setting look for Strip Debug Symbols During Copyand set it to YESfor any production builds.

在目标构建设置的“部署”部分中Strip Debug Symbols During CopyYES查找任何生产构建并将其设置为。

enter image description here

在此处输入图片说明

回答by Xichao Teng

Check the "Strip Style"option in Xcode target's build Setting. If it is "Non-Global Symbols", change it to "All Symbols". this can solve the problem, but I don't know if there are other problems caused by this change.

检查 Xcode 目标的构建设置中的“Strip Style”选项。如果是“非全局符号”,则将其更改为“所有符号”。这样可以解决问题,但不知道有没有因为这个改动引起的其他问题。

回答by ajpallares

What worked for me was the following:

对我有用的是以下内容:

I edited the scheme that I was archiving. In that window, I selected 'Run' and then the tab 'Info'. In 'Build Configuration' I had changed it to 'Release'. I just changed it to 'Debug' (option by default) and that warning went away.

我编辑了我正在归档的方案。在那个窗口中,我选择了“运行”,然后选择了“信息”选项卡。在“构建配置”中,我已将其更改为“发布”。我只是将其更改为“调试”(默认选项)并且该警告消失了。

I hope this helps.

我希望这有帮助。

回答by Darth Philou

This is probably because you archive with the the DEBUG scheme. If you select the RELEASE scheme, then the option "strip debug symbols during copy" is set to YES and you do not have this warning.

这可能是因为您使用 DEBUG 方案存档。如果您选择 RELEASE 方案,则选项“在复制期间剥离调试符号”将设置为 YES,并且您不会收到此警告。

I suggest to archive with DEBUG settings for beta testing, but with RELEASE settings for publication in the App Store.

我建议使用 DEBUG 设置进行 beta 测试存档,但使用 RELEASE 设置在 App Store 中发布。