SIGBART错误& backtrace没有显示任何有用的东西

时间:2018-01-23 18:13:18

标签: ios swift runtime-error xcode9

我正在使用swift在xcode 9中构建应用程序。我最近使用可可豆荚将firebase安装到我的项目中。我很确定我正确安装了这个,但是在进行了更改并且弄乱了我的视图控制器之后的一段时间我开始得到“线程1:信号SIGBART”错误。使用'bt'给我以下代码似乎完全没用。

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x0000000107a7be3e libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x0000000107ab5150 libsystem_pthread.dylib`pthread_kill + 333
frame #2: 0x00000001077360eb libsystem_c.dylib`abort + 127
frame #3: 0x000000010815599b GraphicsServices`_GSEventInitializeApp + 713
frame #4: 0x00000001048a391d UIKit`_UIApplicationMainPreparations + 781
frame #5: 0x00000001048a35a6 UIKit`UIApplicationMain + 111
frame #6: 0x0000000102106bf7 Small Talk`main at AppDelegate.swift:16
frame #7: 0x0000000107663d81 libdyld.dylib`start + 1 *

当应用程序在模拟器中打开,出现加载屏幕,然后在到达第一个视图控制器之前崩溃时,似乎发生了错误。我已经查看了所有参考文献并删除了每个参考文献都没有解决问题。任何人都知道如何调试它?

AppDelegate.swift:

    //
    //  AppDelegate.swift
    //  Small Talk
    //
    //  Created by Alex Hill on 1/4/18.
    //  Copyright © 2018 Kirkland Productions. All rights reserved.
    //

    import UIKit
    import Firebase


    import UIKit

    @UIApplicationMain
    class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(_ application: UIApplication, didFinishLaunchingWithOptions 
    launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        FIRApp.configure()
        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 invalidate graphics rendering callbacks. 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 active 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:.
    }


}

ViewController.swift:

//
//  ViewController.swift
//  Small Talk
//
//  Created by Alex Hill on 1/4/18.
//  Copyright © 2018 Kirkland Productions. All rights reserved.
//

import UIKit

class LaunchWelcomeVC: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        //setting custom back button
        let backButton = UIBarButtonItem(title: "Back", style: UIBarButtonItemStyle.plain, target: self, action: nil)
        backButton.setTitleTextAttributes([NSAttributedStringKey.font: UIFont(name: "GillSans-UltraBold", size: 17)!], for: UIControlState.normal)
        navigationItem.backBarButtonItem = backButton

        //setting navigation bar style
        self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.clear]

        self.navigationController?.navigationBar.shadowImage = UIImage()
        self.navigationController?.navigationBar.tintColor = UIColor.white
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        //
    }

    @IBAction func LoginButtonTapped(_ sender: Any) {
        self.performSegue(withIdentifier: "LaunchWelcomeToLogin", sender: self)
    }

    @IBAction func SignupButtonTapped(_ sender: Any) {
        self.performSegue(withIdentifier: "LaunchWelcomeToSignup", sender: self)
    }

}

1 个答案:

答案 0 :(得分:0)

原来我的xcode项目的包标识符错误了。我使用的是firebase,项目标识错误。我还重新下载了GoogleService-Info.plist。感谢所有提出想法的人