Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 8 (Swift 3) Command failed due to signal: Killed: 9

Tags:

xcode

ios

swift

After upgrading to Xcode 8 and converting all my code to Swift 3, I have troubles compiling swift resources. It takes a very long time, and my computer gets super laggy and after about 30 minutes I get this

CompileSwift normal arm64 /Users/choojayson/Dropbox/BottomsUp/Thirst/UserDrank.swift cd /Users/choojayson/Dropbox/BottomsUp /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/choojayson/Dropbox/BottomsUp/Thirst/PendingVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/NotificationCell.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/ProfileCell.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/NotificationsVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/UserPendingAction.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/ChooseDrinkVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/AppDelegate.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/UserCell.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/FirebaseReferences.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/ProfileStatsCell.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/UserDrankTime.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/MyProfileVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/ProfileStatsFooterCell.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/WeeklyDrank.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/DrinkList.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/DrinkCell.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/User.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/HeaderCell.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/EndorseVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/GlobalScore.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/Username.swift /Users/choojayson/Dropbox/BottomsUp/HomeVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/LoginVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/LeaderBoardVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/CollectionViewHeaderCell.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/Global.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/CircularTransition.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/Drink.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/WeeklyBestVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/DrinkStatus.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/LeaderBoardCell.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/PendingCell.swift -primary-file /Users/choojayson/Dropbox/BottomsUp/Thirst/UserDrank.swift -target arm64-apple-ios8.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk -I /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Products/Debug-iphoneos -F /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Products/Debug-iphoneos -F /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Products/Debug-iphoneos/SDWebImage -F /Users/choojayson/Dropbox/BottomsUp/Pods/FirebaseAnalytics/Frameworks/frameworks -F /Users/choojayson/Dropbox/BottomsUp/Pods/FirebaseAuth/Frameworks/frameworks -F /Users/choojayson/Dropbox/BottomsUp/Pods/FirebaseDatabase/Frameworks -F /Users/choojayson/Dropbox/BottomsUp/Pods/FirebaseInstanceID/Frameworks/frameworks -F /Users/choojayson/Dropbox/BottomsUp/Pods/FirebaseMessaging/Frameworks/frameworks -F /Users/choojayson/Dropbox/BottomsUp/Pods/FirebaseStorage/Frameworks -F /Users/choojayson/Dropbox/BottomsUp/Pods/GoogleIPhoneUtilities/Frameworks -F /Users/choojayson/Dropbox/BottomsUp/Pods/GoogleInterchangeUtilities/Frameworks -F /Users/choojayson/Dropbox/BottomsUp/Pods/GoogleNetworkingUtilities/Frameworks -F /Users/choojayson/Dropbox/BottomsUp/Pods/GoogleParsingUtilities/Frameworks -F /Users/choojayson/Dropbox/BottomsUp/Pods/GoogleSymbolUtilities/Frameworks -F /Users/choojayson/Dropbox/BottomsUp/Pods/GoogleUtilities/Frameworks -F /Users/choojayson/Dropbox/BottomsUp -enable-testing -g -module-cache-path /Users/choojayson/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc -I/Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/Thirst-generated-files.hmap -Xcc -I/Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/Thirst-own-target-headers.hmap -Xcc -I/Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/Thirst-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/Thirst-project-headers.hmap -Xcc -I/Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Products/Debug-iphoneos/include -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Firebase/Analytics/Sources -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/Firebase -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/FirebaseAnalytics -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/FirebaseAuth -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/FirebaseDatabase -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/FirebaseInstanceID -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/FirebaseMessaging -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/FirebaseStorage -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/GoogleIPhoneUtilities -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/GoogleInterchangeUtilities -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/GoogleNetworkingUtilities -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/GoogleParsingUtilities -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/GoogleSymbolUtilities -Xcc -I/Users/choojayson/Dropbox/BottomsUp/Pods/Headers/Public/GoogleUtilities -Xcc -I/Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/DerivedSources/arm64 -Xcc -I/Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc -working-directory/Users/choojayson/Dropbox/BottomsUp -emit-module-doc-path /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/Objects-normal/arm64/UserDrank~partial.swiftdoc -Onone -module-name Thirst -emit-module-path /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/Objects-normal/arm64/UserDrank~partial.swiftmodule -serialize-diagnostics-path /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/Objects-normal/arm64/UserDrank.dia -emit-dependencies-path /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/Objects-normal/arm64/UserDrank.d -emit-reference-dependencies-path /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/Objects-normal/arm64/UserDrank.swiftdeps -o /Users/choojayson/Library/Developer/Xcode/DerivedData/Thirst-fbgpdykwgpyxllfixfnpenbijinz/Build/Intermediates/Thirst.build/Debug-iphoneos/Thirst.build/Objects-normal/arm64/UserDrank.o -embed-bitcode-marker

like image 503
Jay Choo Avatar asked Sep 22 '16 07:09

Jay Choo


1 Answers

Believe it or not, this is the piece of code that was causing the problem for me. With it in, the compile takes about 30 minutes. If I simply comment out that chunk of code, it compiles in less than 30 seconds.

let params : [String: Any] = [
    "person_id"       : kPersonId,
    "person_promo_id" : promo.personPromoId!,
    "promo_page_id"   : promo.promoPageId!,
    "seq_no"          : promo.seqNo!,
    "promo_type"      : promo.promoType!,
    "page_name"       : promo.pageName!,
    "image_name"      : promo.imageName!,
    "start_date"      : promo.startDate!,
    "end_date"        : promo.endDate!,
    "website"         : promo.website!,
    "facility_name"   : promo.facilityName!,
    "address"         : promo.street!,
    "city"            : promo.city!,
    "prov_state_cd"   : promo.provState!,
    "country_cd"      : promo.country!,
    "contact_name"    : promo.contactName!,
    "contact_phone"   : promo.contactPhone!,
    "latitude"        : promo.latitude!,
    "longitude"       : promo.longitude!,
    "bgColorRed"      : promo.bgColorRed!,
    "bgColorGreen"    : promo.bgColorGreen!,
    "bgColorBlue"     : promo.bgColorBlue!,
    "promoCategories" : promoCat
]

Based on this and other things I have read, I would hunt for a case where you're assigning values to a large or nested dictionary with an Any or AnyObject in the definition. I'm guessing that it's the Any that is sending the compiler off on a wild good chase.

If you check your log where it fails, it should have the error right at the object that failed. This should give you a clue as to what file to look in.

Edit: @Jay Chow, this is how I solved the compiler problem with the code above:

var params : [String : Any] = [:]
params["person_id"]         = kPersonId
params["person_promo_id"]   = promo.personPromoId
params["promo_page_id"]     = promo.promoPageId
params["seq_no"]            = promo.seqNo
params["promo_type"]        = promo.promoType
params["page_name"]         = promo.pageName
params["image_name"]        = promo.imageName
params["start_date"]        = promo.startDate
params["end_date"]          = promo.endDate
params["website"]           = promo.website
params["facility_name"]     = promo.facilityName
params["address"]           = promo.street
params["city"]              = promo.city
params["prov_state_cd"]     = promo.provState
params["country_cd"]        = promo.country
params["contact_name"]      = promo.contactName
params["contact_phone"]     = promo.contactPhone
params["latitude"]          = promo.latitude
params["longitude"]         = promo.longitude
params["bgColorRed"]        = promo.bgColorRed
params["bgColorGreen"]      = promo.bgColorGreen
params["bgColorBlue"]       = promo.bgColorBlue
params["promoCategories"]   = promoCat
like image 82
Lastmboy Avatar answered Oct 15 '22 04:10

Lastmboy