SIGBART 错误和回溯没有显示任何有用的内容



我正在使用 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 *

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

应用委托.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:.
    }

}

视图控制器.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)
    }
}

事实证明,xcode 项目的捆绑标识符错误。我使用的是 firebase,但项目的项目标识符错误。我还重新下载了GoogleService-Info.plist。感谢所有提出想法的人

相关内容

最新更新