Xcode 6.0.1 Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

后端 未结 24 2397
长情又很酷
长情又很酷 2020-11-27 13:18

I am getting this error on archive:

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with

24条回答
  •  北荒
    北荒 (楼主)
    2020-11-27 13:42

    one more case that can lead to this error which just took me hours to track down: a failable initializer that always returns nil.

    i had an initializer that looked like this:

    init?(object: MyObject) {
        if object.importantProperty {
            // initialize
        }
        return nil
    }
    

    when what i meant was:

    init?(object: MyObject) {
        if object.importantProperty {
            // initialize
        }
        else {
            return nil
        }
    }
    

    fixing the initializer made the error go away.

提交回复
热议问题