【问题标题】:Application crash when calling method 'FirebaseApp.configure()' in a real device在真实设备中调用方法“FirebaseApp.configure()”时应用程序崩溃
【发布时间】:2020-02-16 14:48:36
【问题描述】:

最近决定在真机上运行应用,收到一个crash应用,找原因,发现出现在FirebaseApp.configure()方法之后。

应用程序在模拟器中启动时不会崩溃。

崩溃:

dyld`__abort_with_payload:
    0x101b0b2a4 <+0>:  mov    x16, #0x209
    0x101b0b2a8 <+4>:  svc    #0x80
->  0x101b0b2ac <+8>:  b.lo   0x101b0b2c8               ; <+36>
    0x101b0b2b0 <+12>: stp    x29, x30, [sp, #-0x10]!
    0x101b0b2b4 <+16>: mov    x29, sp
    0x101b0b2b8 <+20>: bl     0x101b097d8               ; cerror_nocancel
    0x101b0b2bc <+24>: mov    sp, x29
    0x101b0b2c0 <+28>: ldp    x29, x30, [sp], #0x10
    0x101b0b2c4 <+32>: ret    
    0x101b0b2c8 <+36>: ret    

有了这个回溯:

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x0000000101b0b2ac dyld`__abort_with_payload + 8
    frame #1: 0x0000000101b12914 dyld`abort_with_payload_wrapper_internal + 104
    frame #2: 0x0000000101b12948 dyld`abort_with_payload + 16
    frame #3: 0x0000000101b0f77c dyld`dyld::halt(char const*) + 380
    frame #4: 0x0000000101ac0778 dyld`dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 176
    frame #5: 0x00000001b207963c libdyld.dylib`_dyld_fast_stub_entry(void*, long) + 80
    frame #6: 0x00000001b2077b80 libdyld.dylib`dyld_stub_binder + 60
    frame #7: 0x0000000100b88258 CheeseApp`__44+[UIViewController(APMScreenClassName) load]_block_invoke + 144
    frame #8: 0x000000010204327c libdispatch.dylib`_dispatch_client_callout + 20
    frame #9: 0x0000000102044c88 libdispatch.dylib`_dispatch_once_callout + 132
    frame #10: 0x0000000100b881c4 CheeseApp`+[UIViewController(APMScreenClassName) load] + 76
    frame #11: 0x00000001b1fa1500 libobjc.A.dylib`load_images + 1176
    frame #12: 0x0000000101abe19c dyld`dyld::notifySingle(dyld_image_states, ImageLoader const*, ImageLoader::InitializerTimingList*) + 480
    frame #13: 0x0000000101ace444 dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 556
    frame #14: 0x0000000101acd094 dyld`ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 192
    frame #15: 0x0000000101acd160 dyld`ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 96
    frame #16: 0x0000000101abe4f8 dyld`dyld::initializeMainExecutable() + 220
    frame #17: 0x0000000101ac3038 dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 4668
    frame #18: 0x0000000101abd22c dyld`dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) + 432
    frame #19: 0x0000000101abd038 dyld`_dyld_start + 56

AppDelegate:

import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        FirebaseApp.configure()
        return true
    }

    // MARK: UISceneSession Lifecycle

    func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
        // Called when a new scene session is being created.
        // Use this method to select a configuration to create the new scene with.
        return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
    }

    func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
        // Called when the user discards a scene session.
        // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
        // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
    }
}

我尝试了什么:

  1. 我更新了根目录下的 GoogleService-Info.plist 文件
  2. 我更新了 pod 文件中的所有库
  3. 我尝试通过禁用方案中的地址清理程序来解决问题
  4. 我尝试通过“将文件添加到...”添加 .plist 文件
  5. 我尝试运行这样的方法:
    override init() {
        FirebaseApp.configure()
    }
  1. 我更新了“Linked Binary With Libraries”中的库

但没有任何帮助。

【问题讨论】:

标签: ios swift firebase crash appdelegate


【解决方案1】:

这是 Apple 阻止免费开发者帐户使用从 iOS 13.3.1 开始的动态框架的另一个症状。

选项包括 - 升级到付费开发者帐户 - 降级到 13.3。 - 对于 CocoaPods,使用 use_modular_headers! 而不是 use_frameworks!

另见Library not loaded: @rpath/FBLPromises.framework/FBLPromises iOS 13.3.1

【讨论】:

  • 哇,哇。把我的头发拉出来,直到我找到这个。谢谢!!!
【解决方案2】:

这可能是由于发布版本中未加载库图像。查看是否在“构建阶段”的“与库链接的二进制文件”部分中检查了库。

【讨论】:

猜你喜欢
  • 2019-12-05
  • 1970-01-01
  • 1970-01-01
  • 2017-10-12
  • 1970-01-01
  • 2023-04-01
  • 1970-01-01
  • 1970-01-01
  • 2018-07-23
相关资源
最近更新 更多