【问题标题】:SourceKitService Crashed in Xcode 6.1.1SourceKitService 在 Xcode 6.1.1 中崩溃
【发布时间】:2014-12-23 08:41:20
【问题描述】:

我开始遇到 Xcode 6.0.1 问题,错误 "SourceKitService Crashed Crashlog generated in ~/Library/Logs/DiagnosticReports" 开始弹出,并且所有语法高亮在 Swift 中都消失了。然后,Apple 发布了一个新的更新 Xcode 6.1.1,其中提到了此问题已得到解决。所以我将我的 Xcode 更新到 6.1.1,但这个问题仍然存在。我的情况是,问题只是留在那里,永远不会消失。

我尝试了一些在 StackOverflow 中找到的解决方案,例如删除以下内容:DerivedData/ModuleCache、清理项目等,但问题仍然存在。

我无法进行构建,并且每当我尝试得到这 2 个错误时。

/Users/MY_PROJECT/AppDelegate.swift:11:1: 'UIApplicationMain' class must conform to the 'UIApplicationDelegate'

我的 AppDelegate.h 文件中 UIApplicationMain 的协议,此命令因信号而失败:Segmentation fault: 11

这是我的 AppDelegate.swift 的代码

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
    return true
}

func applicationWillResignActive(application: UIApplication!) {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication!) {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication!) {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication!) {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication!) {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}

【问题讨论】:

  • 在 6.1.1 中仍有许多源工具包服务可能崩溃的情况。查看 App Store 中 Xcode 的评论部分。我每天都会看到几次这样的崩溃,但它们通常不会再删除语法突出显示。

标签: ios xcode swift ios8 xcode6


【解决方案1】:

我不确定这个错误的原因,由于各种原因,我遇到了这个 sourcekit 崩溃。对于您来说,如果您查看 UIApplicationDelegate 方法,它们在签名中会略有变化。例如UIApplication 参数现在不是可选的。

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Override point for customization after application launch.
        return true
    }

因此,如果您将委托方法与新的 UIApplicationDelegate 方法进行比较(如果您使用命令+单击,您可以检查方法签名)并进行更改,您可能会摆脱此错误。试一下。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多