[英]How to fix “Bus error 10” after update to Xcode 10.2
I updated Xcode to new stable 10.2v. 我将Xcode更新为新的稳定版10.2v。 I tried to build my project and it was successful.
我试图建立我的项目,但它很成功。 When I'm trying to archive the project (workspace), I'm getting errors like on screenshot below:
当我试图归档项目(工作区)时,我收到的错误如下面的截图:
What I've tried so far: 到目前为止我尝试过的:
For me it was only the Cache
framework. 对我来说,它只是
Cache
框架。 Until they have fixed it, you can manually set SWIFT_OPTIMIZATION_LEVEL
to -Onone
for the configuration you want to use for archiving. 在修复它之前,您可以手动将
SWIFT_OPTIMIZATION_LEVEL
设置为-Onone
,以用于要用于存档的配置。
You could even use your Podfile if you don't want Cococapods to overwrite the settings every time you run pod install
如果您不希望每次运行
pod install
时Cococapod都覆盖设置,您甚至可以使用Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if target.name == 'Cache'
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
end
end
end
end
Note that this is specifically checking for the
Cache
framework.请注意,这是专门检查
Cache
框架。 If you have problems with other frameworks you might want to change or extend this condition.如果您遇到其他框架问题,可能需要更改或扩展此条件。
While Lukas' answer of disabling optimization on the Cache pod works, I followed Alex's link to the issue in their GitHub repo and found there is an open pull request with a pretty simple code change that fixes it. 虽然Lukas在缓存窗口上禁用优化的答案有效,但我在他们的GitHub仓库中跟踪了Alex的问题链接,发现有一个开放的拉取请求,其中包含一个非常简单的代码更改,可以修复它。 I unlocked the file and made the change locally.
我解锁了文件并在本地进行了更改。
Here's the PR: https://github.com/hyperoslo/Cache/pull/236 这是PR: https : //github.com/hyperoslo/Cache/pull/236
Apply this diff: https://github.com/hyperoslo/Cache/pull/236/commits/560f00a9a9549db161ca70d96eed74fc580b03e3#diff-9e53dc1370d4f7c9cdaaa103d26ff096 应用这个差异: https : //github.com/hyperoslo/Cache/pull/236/commits/560f00a9a9549db161ca70d96eed74fc580b03e3#diff-9e53dc1370d4f7c9cdaaa103d26ff096
Which, to repeat here, is in the file MD5.swift change the safe_add
function to be: 其中,重复一下,在文件MD5.swift中将
safe_add
函数更改为:
func safe_add(_ x: Int32, _ y: Int32) -> Int32 {
return x &+ y
}
(Disclaimer: I do not claim to know the correctness of the change, but it seems the delay merging the PR is due to figuring out who is currently maintaining the repo.) (免责声明:我并不声称知道更改的正确性,但似乎延迟合并PR是因为弄清楚谁正在维护回购。)
The answer is here: https://github.com/hyperoslo/Cache/issues/238 答案在这里: https : //github.com/hyperoslo/Cache/issues/238
We are waiting for the owners of this repo to make any sign of life... 我们正在等待这个回购的所有者做出任何生命迹象......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.