Swift 项目构建并运行但无法存档 [英] Swift Project Builds and runs but fails to Archive

查看:50
本文介绍了Swift 项目构建并运行但无法存档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 xcode 项目并在设备上运行,调试构建一切正常.

I have a xcode project and running on the device, debug build everything is fine.

但是,当我尝试存档项目时,我从 Swift 编译器中收到了段错误:

However when i try to archive the project im getting a segfault from the Swift Compiler:

0  swift                    0x0000000105c36608 llvm::sys::PrintStackTrace(__sFILE*) + 40
1  swift                    0x0000000105c36af4 SignalHandler(int) + 452
2  libsystem_platform.dylib 0x00007fff852705aa _sigtramp + 26
3  libsystem_platform.dylib 0x0000000000000002 _sigtramp + 2061040242
4  swift                    0x0000000105f51896            swift::TypeBase::getTypeOfMember(swift::Module*, swift::ValueDecl const*,    swift::LazyResolver*, swift::Type) + 534
5  swift                    0x00000001050eee38 swift::SILType::getFieldType(swift::VarDecl*, swift::SILModule&) const + 56
6  swift                    0x00000001051a1252 (anonymous namespace)::SILSROA::run() + 3602
7  swift                    0x000000010516b116 swift::SILPassManager::runFunctionPasses(llvm::ArrayRef<swift::SILFunctionTransform*>) + 310
8  swift                    0x000000010516b6f9 swift::SILPassManager::runOneIteration() + 761
9  swift                    0x000000010516b92b swift::SILPassManager::run() + 251
10 swift                    0x000000010516afbc swift::runSILOptimizationPasses(swift::SILModule&, swift::SILOptions const&) + 1644
11 swift                    0x0000000104ffb141 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 3537
12 swift                    0x0000000104ffa35d main + 1533
13 libdyld.dylib            0x00007fff885d75fd start + 1
14 libdyld.dylib            0x0000000000000052 start + 2007140950

我看到有人在谈论某些可能导致此类错误的语法,但有没有人知道如何尝试找出导致段错误的代码位?

I have seen people talking about certain synta that can cause this kind of error, but does anyone know how to try and track down which bit(s) of the code is causing the segfault?

推荐答案

我遇到了类似的问题,解决方案"是在构建设置中将 swift 编译器代码生成优化级别变为 -Onone发布配置.这是从 Xcode 6.0.1 开始的.

I had a similar issue and the "solution" was to turn swift compiler code generation optimization level to -Onone in build settings for the release configuration. This is as of Xcode 6.0.1.

这篇关于Swift 项目构建并运行但无法存档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆