ios - SIGBART 错误和回溯未显示任何有用的内容

标签 ios swift runtime-error xcode9

我正在使用 swift 在 xcode 9 中构建一个应用程序。我最近使用 cocoa pod 将 firebase 安装到我的项目中。我相当确定我安装正确,但是在进行更改并摆弄 View Controller 一段时间后,我开始收到“Thread 1:signal 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 *

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

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)
    }

}

最佳答案

结果我的 xcode 项目的包标识符错误。我正在使用 firebase 并且该项目的项目标识符错误。我还重新下载了 GoogleService-Info.plist。感谢所有提供想法的人

关于ios - SIGBART 错误和回溯未显示任何有用的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48408265/

相关文章:

c - 使用修改的快速排序从数组中选择 k 个最小元素时出现运行时错误

ios - 带分页的UITableView,每个cell是一个UIScrollView

ios - Xcode 9,迦太基。 iTunes 连接错误 : "Invalid Bundle - Disallowed LLVM instrumentation"

ios - 更改不同类的 CCSpeed Action ?

ios - Callkit 可以与非 voip 调用一起使用以获取 ios 中的调用状态吗?

ios - 如何更改 iOS 13 中 tabBar 的框架?

ios - Xcode 方案的 "analyze"部分中的 "test"、 "Build"和其他复选框是什么?

ios - Swift iOS 中带有特征集合的自适应布局

c++ - 是什么导致了这个运行时错误,我该如何纠正它?

ruby-on-rails - Ruby on Rails ActiveModel::MassAssignmentSecurity::错误