Swift compile error in XCode 6 GM

5.1k views Asked by At

I'm using a new Swift language for develop IOS application. Suddenly i got an error from my XCode.

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


CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
cd /Users/bobo/Desktop/MyProject/ios
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -target armv7-apple-ios7.0 -module-name MyProject -Onone -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -g -module-cache-path /Users/bobo/Library/Developer/Xcode/DerivedData/ModuleCache -I /Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Products/Debug-iphoneos -F /Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Products/Debug-iphoneos -F MyProject -c -j4 /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerWiFiSettings.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerEthernet.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellWiFi.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerWidgets.swift /Users/bobo/Desktop/MyProject/ios/MyProject/DAOMyProjectsGroup.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerWifiSecurity.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerWithMenu.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellSettingsHeader.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellSettingsSlider.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerAllSettings.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellTimeZone.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerVerifyMyProject.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellSettingsWiFi.swift /Users/bobo/Desktop/MyProject/ios/MyProject/NSTimerExtension.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectApiHelper.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerSlidingMenu.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectBluetooth.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerAppSettings.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerSettingsList.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectAudio.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerConnectToWiFiError.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProject.swift /Users/bobo/Desktop/MyProject/ios/MyProject/LiveNibViewCell.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerMyProjectsHolder.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectAvailableWiFi.swift /Users/bobo/Desktop/MyProject/ios/MyProject/NSTimeZoneExtension.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectAppWrapper.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerMyProjectName.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerWiFiNetworkSettings.swift /Users/bobo/Desktop/MyProject/ios/MyProject/Constants.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellSettingsInputField.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectModeDrawer.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerAccessPoint.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectWiFi.swift /Users/bobo/Desktop/MyProject/ios/MyProject/LiveNibView.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellSettingsInfo.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerSetupSuccess.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerMyProjectsList.swift /Users/bobo/Desktop/MyProject/ios/MyProjectEthernet.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewPager.swift /Users/bobo/Desktop/MyProject/ios/MyProject/UpnpUtils.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectApp.swift /Users/bobo/Desktop/MyProject/ios/MyProject/UiUtils.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellSettingsInfoWithArrow.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellMenuHeader.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellSettingsSwitch.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellSettingsInfoTime.swift /Users/bobo/Desktop/MyProject/ios/MyProject/KeyboardHandler.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerTimeZonesList.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellMenuMyProject.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerHowToConnect.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerBaseSetup.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellMyProjectOnline.swift /Users/bobo/Desktop/MyProject/ios/MyProject/NavigationControllerSlidingMenu.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerAppArrayItemProperties.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerListWiFiNetworks.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellMyProjectOffline.swift /Users/bobo/Desktop/MyProject/ios/MyProject/IMyProject.swift /Users/bobo/Desktop/MyProject/ios/MyProject/DevUtils.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectModeItem.swift /Users/bobo/Desktop/MyProject/ios/MyProject/AppDelegate.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerVerificationCodeError.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerEnterWiFiPassword.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectInfo.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerAppArrayProperties.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerDateAndTimeSettings.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectDatabaseManager.swift /Users/bobo/Desktop/MyProject/ios/MyProject/AppPreferencesHelper.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerChangeAppProperty.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerStore.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerMyProjectHolder.swift /Users/bobo/Desktop/MyProject/ios/MyProject/SettingsSlider.swift /Users/bobo/Desktop/MyProject/ios/MyProject/BottomDrawer.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerScanningForMyProjects.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellAppPropertyHeader.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectAppDescriptor.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerConnectedWiFiSettings.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ButtonWithColorBackground.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellSettingsCheck.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellWidget.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectSetupController.swift /Users/bobo/Desktop/MyProject/ios/MyProject/CellSettingsInfoWithIcon.swift /Users/bobo/Desktop/MyProject/ios/MyProject/DAOMyProject.swift /Users/bobo/Desktop/MyProject/ios/MyProject/ViewControllerSetUpMyProject.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectClock.swift /Users/bobo/Desktop/MyProject/ios/MyProject/MyProjectDisplay.swift -output-file-map /Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Intermediates/MyProject.build/Debug-iphoneos/MyProject.build/Objects-normal/armv7/MyProject-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Intermediates/MyProject.build/Debug-iphoneos/MyProject.build/Objects-normal/armv7/MyProject.swiftmodule -Xcc -I/Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Intermediates/MyProject.build/Debug-iphoneos/MyProject.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Intermediates/MyProject.build/Debug-iphoneos/MyProject.build/MyProject-generated-files.hmap -Xcc -I/Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Intermediates/MyProject.build/Debug-iphoneos/MyProject.build/MyProject-own-target-headers.hmap -Xcc -I/Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Intermediates/MyProject.build/Debug-iphoneos/MyProject.build/MyProject-all-target-headers.hmap -Xcc -iquote -Xcc /Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Intermediates/MyProject.build/Debug-iphoneos/MyProject.build/MyProject-project-headers.hmap -Xcc -iquoteMyProject/upnpx/api -Xcc -iquoteMyProject/upnpx/api/port/ios -Xcc -I/Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Products/Debug-iphoneos/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Intermediates/MyProject.build/Debug-iphoneos/MyProject.build/DerivedSources/armv7 -Xcc -I/Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Intermediates/MyProject.build/Debug-iphoneos/MyProject.build/DerivedSources -Xcc -DDEBUG=1 -emit-objc-header -emit-objc-header-path /Users/bobo/Library/Developer/Xcode/DerivedData/MyProject-diekcgczcwnrhtfxrpqbqsfywosi/Build/Intermediates/MyProject.build/Debug-iphoneos/MyProject.build/Objects-normal/armv7/MyProject-Swift.h -import-objc-header /Users/bobo/Desktop/MyProject/ios/MyProject/MyProject-Bridging-Header.h 

XCode version - 6 GM (It's a latest stable version). Somebody know how fix this issue?

3

There are 3 answers

0
Slavik Voloshyn On BEST ANSWER

I found solution, but it's not a best way. After reinstall XCode this issue was fixed.

2
Pintouch On

Did you try removing your project folder in the DerivedData folder before reinstalling xCode?

I had the same problem updating from beta 6 to beta 7, and that solved the problem.

0
tuoxie007 On

I had the same problem, then I use git checkout old versions to find which commit cause the problem, and try to find the key problem code. My key problem code is something like this

func afunc() {
    class AClass() {
    }
    let ac = AClass()
    //....
}

Other code could make the same problem, occur in Swift Optimization, and swift compiler doesn't tell you the exact location. This must be a bug by Apple.