Xcode 存档调试条错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11743075/
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 Archive debug strip errors
提问by HatAndBeard
I am trying to integrate a large legacy C++ library with an iOS app. We are able to build and run on device but we are not able to archive the app. Archiving fails with the following error.
我正在尝试将大型遗留 C++ 库与 iOS 应用程序集成。我们能够在设备上构建和运行,但我们无法存档应用程序。归档失败并出现以下错误。
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip failed with exit code 1
命令 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip 失败,退出代码为 1
I did a "-v" on the strip and get a series of warnings similar to
我在条带上做了一个“-v”并得到一系列类似于
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: symbols referenced by relocation entries that can't be stripped in:/MyApp/DerivedData/SmartMusic_iPad/Build/Intermediates/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/UninstalledProducts/libMyLib-iOS.a(MyWhatever.o)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip:无法剥离的重定位条目引用的符号:/MyApp/DerivedData/SmartMusic_iPad/Build/Intermediates/ArchiveIntermediates/MyApp /IntermediateBuildFilesPath/UninstalledProducts/libMyLib-iOS.a(MyWhatever.o)
It is not clear if this message is a warning or the reason for the failure. There are no other indications of problems in the strip output. Any clues?
目前尚不清楚此消息是警告还是失败的原因。条输出中没有其他问题迹象。有什么线索吗?
回答by donnadupuis
Under build settings for the static library target, select NO for 'deployment postprocessing' and 'strip debug symbols during copy'. It is compiled code so it doesn't need symbols stripped. I was experiencing the same error ('usr/bin/strip failed with exit code 1') and this fixed it for me.
在静态库目标的构建设置下,为“部署后处理”和“复制期间剥离调试符号”选择“否”。它是编译代码,因此不需要剥离符号。我遇到了同样的错误('usr/bin/strip failed with exit code 1'),这为我修复了它。
回答by Roberto Ferraz
In my case I added the following to my library Target build settings and started working fine:
就我而言,我将以下内容添加到我的库目标构建设置中并开始正常工作:
Dead Code Stripping: NO
Strip Debug Symbols During Copy: NO for all configurations
Strip Style: Non-Global Symbols
死代码剥离:否
在复制过程中剥离调试符号:所有配置均为否
条带样式:非全局符号
回答by trojanfoe
There are different options to strip
(see manpage) and I think you'll want to use the -r
option. You can set the typeof stripping to perform from within the Xcode project settings. See if you can relate the options in Xcode with the options in the manpage.
有不同的选项strip
(请参阅联机帮助页),我认为您会想要使用该-r
选项。您可以在 Xcode 项目设置中设置要执行的剥离类型。看看您是否可以将 Xcode 中的选项与联机帮助页中的选项相关联。
回答by Gbaba
I fixed this error by freeing up more space
我通过释放更多空间修复了这个错误
回答by Tai Le
I have same your problem, but I edit DEPLOYMENT POSTPROCESSING
to NO
but it doesn't work.
我有同样的问题,但我编辑DEPLOYMENT POSTPROCESSING
为NO
但它不起作用。
I just went to Build Phases
tab in my target, and in Copy Bundle Resources
I removed Foundation.framework
, and then I add Foundation.framework
into Link Binary With Libraries
, it works for me!
我只是Build Phases
在我的目标中选择了标签,然后在Copy Bundle Resources
我删除了Foundation.framework
,然后添加Foundation.framework
到 中Link Binary With Libraries
,它对我有用!
Hope that will be solve your problem!
希望能解决你的问题!
回答by Mecki
The default Strip Style
in Xcode is All Symbols
, which is okay for an executable but for a library you need to set this to Non-Global Symbols
as global symbols must be be preserved.
Strip Style
Xcode 中的默认值是All Symbols
,这对于可执行文件是可以的,但对于库,您需要将其设置Non-Global Symbols
为必须保留全局符号。
Since stripping is only done as part of the deployment post processing, debug builds are usually not affected by this option as for them the setting DEPLOYMENT_POSTPROCESSING is usually set to NO. But when archiving, though, you create a release build and here DEPLOYMENT_POSTPROCESSING is set to YES by default and thus you need to have the correct strip style set.
由于剥离仅作为部署后处理的一部分完成,调试构建通常不受此选项的影响,因为对于它们,设置 DEPLOYMENT_POSTPROCESSING 通常设置为 NO。但是,在归档时,您会创建一个发布版本,并且此处 DEPLOYMENT_POSTPROCESSING 默认设置为 YES,因此您需要设置正确的条带样式。
回答by Olli
What worked for me was when I decided to fix another issue in Xcode 10.1, my simulator hadn't been booting up and I ignored until I really needed it, running the command below helped fix this issue
对我有用的是,当我决定修复 Xcode 10.1 中的另一个问题时,我的模拟器没有启动,我忽略了直到我真的需要它,运行下面的命令有助于解决这个问题
sudo chmod 1777 /private/tmp
回答by shashi shekhar
Try setting
STRIP_INSTALLED_PRODUCT to No for your target(one for which you are getting error) build setting.
if this does not work then try below along with above option
尝试将 STRIP_INSTALLED_PRODUCT 设置为 No 为您的目标(您收到错误的目标)构建设置。
如果这不起作用,请尝试下面以及上面的选项
- Dead Code Stripping: NO
- Strip Debug Symbols During Copy: NO for all configurations
- Strip Style: Non-Global Symbols
- 死代码剥离:否
- 在复制过程中剥离调试符号:所有配置均为否
- 条带样式:非全局符号
Hope this will solved your problem.
希望这能解决您的问题。