Xcode 6 存档并在将“共享扩展名”添加到目标时收到警告“跳过复制阶段条,二进制代码已签名”

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

Xcode 6 Archiving and get a warning "Skipping copy phase strip ,binary is code signed" when add "share extension" to target

iosxcodeios8-share-extension

提问by Kong Hantrakool

I got this warning when I added share extension to my project and archiving it warning: skipping copy phase strip, binary is code signed: /Users/xxxx/xxx/xxxx/Build/xxxx/Build/Intermediates/ArchiveIntermediates/xxxx/IntermediateBui ldFilesPath/UninstalledProducts/XXX.appex/XXXX

当我将共享扩展添加到我的项目并将其存档警告时,我收到此警告:跳过复制阶段条,二进制代码已签名:/Users/xxxx/xxx/xxxx/Build/xxxx/Build/Intermediates/ArchiveIntermediates/xxxx/IntermediateBui ldFilesPath /UninstalledProducts/XXX.appex/XXXX

The old question does not provide and insight to correct this . So I decided to ask again. Warning during archive App with iOS 8 Extension in Xcode 6

旧问题没有提供和洞察力来纠正这一点。所以我决定再问一次。 在 Xcode 6 中使用 iOS 8 扩展归档应用程序期间的警告

Can someone please explain why this is happening ? Is it because the extension target is already code signed? If so, how to solve it ?

有人可以解释为什么会这样吗?是因为扩展目标已经被代码签名了吗?如果是,如何解决?

I knew that setting "Strip debug symbols during copy" to "NO" can clear this warning . But it is not actually solve the problem. And what is the drawback of not "stripping debug symbol"? Because my archive size is still the same whether I set this to YES or NO

我知道将“在复制期间剥离调试符号”设置为“否”可以清除此警告。但实际上并不能解决问题。不“剥离调试符号”的缺点是什么?因为无论我将其设置为 YES 还是 NO,我的存档大小仍然相同

回答by Monstieur

Do notdisable Strip Debug Symbols During Copyin your application project. This will bloat your app (if you have other unsigned dependencies).

难道禁止Strip Debug Symbols During Copy在您的应用程序项目。这将使您的应用程序膨胀(如果您有其他未签名的依赖项)。

It occurs because building the application project attempts to strip the framework but it can't since the framework is already codesigned. However the framework has already been stripped during it's build, so the warning is harmless. Xcode isn't doesn't seem to detect that the codesigned framework has already been stripped.

发生这种情况是因为构建应用程序项目试图剥离框架,但由于框架已经进行了代码设计,所以它不能。然而,框架在构建过程中已经被剥离,所以警告是无害的。Xcode 似乎没有检测到 codesigned 框架已经被剥离。

You should leave it as is.

你应该保持原样。

回答by Luis Ascorbe

"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."

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

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

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

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

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

回答by NeonBerry

I experienced the same warning and solved it by setting "Strip Debug Symbols During Copy" to "NO" in Build Settings of the containing app(not the extension), as you knew.

如您所知,我遇到了同样的警告,并通过在包含应用程序(不是扩展程序)的构建设置中将“复制期间的剥离调试符号”设置为“否”来解决它。

On the other hand, changing the same setting of the extension had no effect. This make clear the actual meaning of the warning. That is, stripping symbol does not mean the symbols "of the target" will be striped, but does mean the target will try to strip symbols "of embedded binaries".

另一方面,更改扩展的相同设置没有效果。这清楚地表明了警告的实际含义。也就是说,剥离符号并不意味着“目标”的符号将被剥离,但确实意味着目标将尝试剥离“嵌入二进制文件”的符号。

Consequently, I believe the actual meaning of the warning would be that Xcode can't strip out debug symbols of the extension binary while archiving the container app, because the extension binary which need to be embedded in the container app "was" already compiled and frozen by code-signing before Xcode tries to strip out symbols of the extension binary while archiving the container app.

因此,我相信警告的实际含义是 Xcode 无法在归档容器应用程序时去除扩展二进制文件的调试符号,因为需要嵌入容器应用程序的扩展二进制文件“已经”编译并且在 Xcode 尝试在归档容器应用程序时去除扩展二进制文件的符号之前,通过代码签名冻结。

It seems like Xcode's default build settings related to striping debug symbols of the embedded extension binaries needs to be correctly updated not to show this warning.

似乎 Xcode 的默认构建设置与嵌入扩展二进制文件的条带化调试符号相关,需要正确更新才能不显示此警告。

回答by Murolau Murolau

In my case was related with 2 AppIcons (I forgot the fill them) , check if you have all the AppIcons in the xxx.xcassets file with the right xxpt. From here I beg Apple to improve this check or enable an auto-tool to complete all the AppIcons set. It is crazy.

在我的情况下,与 2 个 AppIcons 相关(我忘了填写它们),检查 xxx.xcassets 文件中是否有所有 AppIcons 和正确的 xxpt。从这里我请求 Apple 改进此检查或启用自动工具来完成所有 AppIcons 集。这太疯狂了。

回答by Lorenzo

If you are using Xcode 9.34.1, click in the project settings. Use the filter to find the correct setting: type "strip debug". You will find the settings COPY_PHASE_STRIP. Probably is set to "Yes". Set to "No" to remove the warning.

如果您使用的是 Xcode 9.34.1,请在项目设置中单击。使用过滤器找到正确的设置:键入“strip debug”。您将找到设置 COPY_PHASE_STRIP。可能设置为“是”。设置为“否”以删除警告。