У меня всегда была эта проблема, поэтому я начал создавать новое приложение с одним представлением в Swift для iPhone и iPad. Когда цель iOS 8.1, все работает нормально, но если я установил iOS 7.1 (или 7), я получаю ошибку сегментации. Это происходит, когда я иду в Product > Archive, когда я запускаю проект в симуляторе или моем устройстве, все в порядке. Я пробовал с iOS 7 и 8 симуляторами, и он компилируется. Как я уже сказал, проблема не в коде, так как он ведет себя таким образом даже с вновь созданным проектом.
CompileSwift normal armv7 /Users/francesco/Documents/XCode Projects/Prova/Prova/ViewController.swift
cd /Users/francesco/Documents/XCode Projects/Prova
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file "/Users/francesco/Documents/XCode Projects/Prova/Prova/ViewController.swift" "/Users/francesco/Documents/XCode Projects/Prova/Prova/AppDelegate.swift" -target armv7-apple-ios7.1 -target-cpu cortex-a8 -target-abi apcs-gnu -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -I /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos -F /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos -g -module-cache-path /Users/francesco/Library/Developer/Xcode/DerivedData/ModuleCache -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-generated-files.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-own-target-headers.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-all-target-headers.hmap -Xcc -iquote -Xcc /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-project-headers.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/DerivedSources/armv7 -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/DerivedSources -emit-module-doc-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController~partial.swiftdoc -O -module-name Prova -emit-module-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController~partial.swiftmodule -serialize-diagnostics-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.dia -emit-dependencies-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.d -o /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.o
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/francesco/Documents/XCode Projects/Prova/Prova/ViewController.swift /Users/francesco/Documents/XCode Projects/Prova/Prova/AppDelegate.swift -target armv7-apple-ios7.1 -target-cpu cortex-a8 -target-abi apcs-gnu -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -I /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos -F /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos -g -module-cache-path /Users/francesco/Library/Developer/Xcode/DerivedData/ModuleCache -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-generated-files.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-own-target-headers.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-all-target-headers.hmap -Xcc -iquote -Xcc /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-project-headers.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/DerivedSources/armv7 -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/DerivedSources -emit-module-doc-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController~partial.swiftdoc -O -module-name Prova -emit-module-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController~partial.swiftmodule -serialize-diagnostics-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.dia -emit-dependencies-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.d -o /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.o
1. While type-checking 'ViewController' at /Users/francesco/Documents/XCode Projects/Prova/Prova/ViewController.swift:11:1
Command failed due to signal: Segmentation fault: 11
Кто-нибудь знает об этой проблеме?
ОБНОВЛЕНИЕ: я могу настроить таргетинг на armv7s и arm64 на iOS 7, что и вызывает проблему armv7; если armv7 нацелен на iOS 8 и другие на iOS 7, все работает. Это нехорошее решение, поскольку, на мой взгляд, более важно поддерживать старые ОС на старых устройствах.