Command failed due to signal: Abort trap: 6

2020-01-28 04:56发布

Since Xcode 7 and Swift 2.0, I get the error above, like in the screenshot shown here:

screenshot of error log

I have no idea where this is coming from, cleaning and deleting derived data didn't work.

Anyone else experiencing this problem?

Project settings:

project settings

Target settings:

target settings

标签: swift xcode
30条回答
倾城 Initia
2楼-- · 2020-01-28 05:43

Make sure you don't implement a private protocol into class extension. Most of the time would be quite strange to have a private protocol, but not necessary, depending on what you wish to encapsulate.

Something like, in the same file:

class C: ... {
}

extension C: P {
}

private protocol P: class {
}

Do this an you'll surely get Command failed due to signal: Abort trap: 6

Instead remove the private modifier from the protocol and the error is fixed.

查看更多
贼婆χ
3楼-- · 2020-01-28 05:44

I received this when did that:

protocol ProtocolA {
    associatedtype BType: ProtocolB
}

protocol ProtocolB {
    associatedtype AType: ProtocolA
}
查看更多
可以哭但决不认输i
4楼-- · 2020-01-28 05:44

I managed to get my project to build by setting the optimisation level to 'None' under the 'Swift Compiler - Code Generation' menu in the target (not the project) settings. See the screenshot below...

enter image description here

This shouldn't be a permanent solution because it more than doubles the size of the ipa. It should be possible to switch optimisation back on when Xcode 7 comes out of beta.

查看更多
等我变得足够好
5楼-- · 2020-01-28 05:44

In my case, renames several parameters of init methods which is a protocol fails the compilation. I solve it by do it one by one, compiles again after each change.

查看更多
倾城 Initia
6楼-- · 2020-01-28 05:45

I have the same problem with all Xcode 6.3 projects, I open in Xcode 7.0. I created a new project, copied all my source files and resources and everything worked without this compiler error. I thought this has something to do with the project settings. I turned off the Swift compile Optimization to "none" and the Trap 6 was gone away. Perhaps there are other settings, which also generate trouble, but for me this it was.

查看更多
三岁会撩人
7楼-- · 2020-01-28 05:45

for me.. I modified the content of a @objc function like so:

before:

        @objc func didConnectWithSession() {
           context!.stream.disconnectAfterSending()
        }

after:

        @objc func didConnectWithSession() {
           //context!.stream.disconnectAfterSending()
        }

This caused the error. I resolved by removing the entire function.

查看更多
登录 后发表回答