最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

[已解决]Xcode项目编译出错:Command failed due to signal Segmentation fault 11

Xcode crifan 2286浏览 0评论

折腾:

[已解决]swift实现左右联动选择

期间,去写代码,结果

感觉是:

去实现:

ActionSheetCustomPickerDelegate <UIPickerViewDelegate, UIPickerViewDataSource>

的时候,

Xcode时不时的就崩溃了:

并且编译出错

Command failed due to signal: Segmentation fault: 11

CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler

    cd /Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/SalesAppiOS

    export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

    export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk

    export TOOLCHAINS=com.apple.dt.toolchain.iOS9_3

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name SalesApp -Onone -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk -target i386-apple-ios9.0 -g -module-cache-path /Users/crifan/Library/Developer/Xcode/DerivedData/ModuleCache -Xfrontend -serialize-debugging-options -enable-testing -I /Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Products/Debug-iphonesimulator -F /Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Products/Debug-iphonesimulator -F /Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/SalesAppiOS/Carthage/Build/iOS -c -j4 /Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/SalesAppiOS/SalesApp/CrifanLibHttp.swift /Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/SalesAppiOS/SalesApp/ReportViewController.swift 。。。。。。 /Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/SalesAppiOS/SalesApp/CrifanLibDemo.swift /Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/SalesAppiOS/SalesApp/AddTaskViewController.swift -output-file-map /Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Intermediates/SalesApp.build/Debug-iphonesimulator/SalesApp.build/Objects-normal/i386/SalesApp-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Intermediates/SalesApp.build/Debug-iphonesimulator/SalesApp.build/Objects-normal/i386/SalesApp.swiftmodule -Xcc -I/Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Intermediates/SalesApp.build/Debug-iphonesimulator/SalesApp.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Intermediates/SalesApp.build/Debug-iphonesimulator/SalesApp.build/SalesApp-generated-files.hmap -Xcc -I/Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Intermediates/SalesApp.build/Debug-iphonesimulator/SalesApp.build/SalesApp-own-target-headers.hmap -Xcc -I/Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Intermediates/SalesApp.build/Debug-iphonesimulator/SalesApp.build/SalesApp-all-target-headers.hmap -Xcc -iquote -Xcc /Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Intermediates/SalesApp.build/Debug-iphonesimulator/SalesApp.build/SalesApp-project-headers.hmap -Xcc -I/Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Intermediates/SalesApp.build/Debug-iphonesimulator/SalesApp.build/DerivedSources/i386 -Xcc -I/Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Intermediates/SalesApp.build/Debug-iphonesimulator/SalesApp.build/DerivedSources -Xcc -DDEBUG=1 -emit-objc-header -emit-objc-header-path /Users/crifan/Library/Developer/Xcode/DerivedData/SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Intermediates/SalesApp.build/Debug-iphonesimulator/SalesApp.build/Objects-normal/i386/SalesApp-Swift.h -import-objc-header /Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/SalesAppiOS/SalesApp/SalesApp-Bridging-Header.h -Xcc -working-directory/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/SalesAppiOS

<unknown>:0: error: unable to execute command: Segmentation fault: 11

<unknown>:0: error: compile command failed due to signal (use -v to see invocation)

搜:

error: unable to execute command: Segmentation fault: 11

参考:

iOS 开发报错 clang: error: unable to execute command: Segmentation fault: 11 – 博客频道 – CSDN.NET

iOS XCode compile error: unable to execute command: Segmentation fault: 11 – 简书

-》

objective c – iOS XCode compile error: unable to execute command: Segmentation fault: 11 – Stack Overflow

Unable to execute command: Segmentation fault: 11 – Xcode 7.3 beta 4 (7D152p) · Issue #1152 · Carthage/Carthage

注意到,此处就是我正在编辑的文件:

CompileSwift normal i386 

/CustomerDetailViewController.swift

出的错。

后来把:

//    func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {

//        gLog.verbose("pickerView=\(pickerView), row=\(row), component=\(component)")

//        

//        var curTitle = ""

//        

//        switch component {

//        case 0:

//            curTitle = gCurUserItem.customerSourceList[row].text

//        case 1:

//            let firstLevelSelectedRowIndex = pickerView.selectedRowInComponent(0)

//            gLog.verbose("firstLevelSelectedRowIndex=\(firstLevelSelectedRowIndex)")

//            curTitle = gCurUserItem.customerSourceList[firstLevelSelectedRowIndex].subSourceList[row]

//        default:

//            break

//        }

//        

//        gLog.verbose("curTitle=\(curTitle)")

//

//        return curTitle

//    }

注释掉,就可以正常编辑,没有错误了。。。

-》

但是没有解决问题啊。

我还是要用这些protocol的啊。。

后来的后来,发现是自己的语法错误:

某个值的值的值中的某个属性,还没来得及加上,Xcode的代码格式化就崩溃了:

导致没注意到错误

改为:

//            curTitle = gCurUserItem.customerSourceList[firstLevelSelectedRowIndex].subSourceList[row]

            curTitle = gCurUserItem.customerSourceList[firstLevelSelectedRowIndex].subSourceList[row].text

其中的text是自己的定义的类中的属性:

即可解决问题,可以正常编译。

转载请注明:在路上 » [已解决]Xcode项目编译出错:Command failed due to signal Segmentation fault 11

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
56 queries in 0.098 seconds, using 18.35MB memory