【问题标题】:FIrebase iOS integration crash - caused by an invalid GOOGLE_APP_IDFIrebase iOS 集成崩溃 - 由无效的 GOOGLE_APP_ID 引起
【发布时间】:2017-10-16 11:58:26
【问题描述】:

我正在尝试使用 Xcode 构建集成 Firebase 来构建我的 Cordova 应用程序,但我收到了这个模糊的错误,我不明白出了什么问题。我已将GoogleService-Info.plist 文件放在项目目录中,但仍然无法构建。这是堆栈跟踪

2017-05-17 09:56:43.610 MyAppz[824:13611] *** Terminating app due to uncaught exception 'com.firebase.core', 
reason: 'Configuration fails. It may be caused by an invalid GOOGLE_APP_ID in GoogleService-Info.plist 
or set in the customized options.'
    *** First throw call stack:
    (
        0   CoreFoundation                      0x00000001099cdb0b __exceptionPreprocess + 171
        1   libobjc.A.dylib                     0x0000000109409141 objc_exception_throw + 48
        2   CoreFoundation                      0x0000000109a36625 +[NSException raise:format:] + 197
        3   MyAppz                            0x0000000107280b70 +[FIRApp addAppToAppDictionary:] + 371
        4   MyAppz                            0x000000010728011b +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 285
        5   MyAppz                            0x000000010727fe4f +[FIRApp configure] + 302
        6   MyAppz                            0x000000010721c59a -[AppDelegate(FirebasePlugin) application:swizzledDidFinishLaunchingWithOptions:] + 122
        7   UIKit                               0x000000010a804957 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 299
        8   UIKit                               0x000000010a80623c -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4119
        9   UIKit                               0x000000010a80c584 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1709
        10  UIKit                               0x000000010a809793 -[UIApplication workspaceDidEndTransaction:] + 182
        11  FrontBoardServices                  0x000000010fce15f6 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
        12  FrontBoardServices                  0x000000010fce146d -[FBSSerialQueue _performNext] + 186
        13  FrontBoardServices                  0x000000010fce17f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
        14  CoreFoundation                      0x0000000109973c01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        15  CoreFoundation                      0x00000001099590cf __CFRunLoopDoSources0 + 527
        16  CoreFoundation                      0x00000001099585ff __CFRunLoopRun + 911
        17  CoreFoundation                      0x0000000109958016 CFRunLoopRunSpecific + 406
        18  UIKit                               0x000000010a80802f -[UIApplication _run] + 468
        19  UIKit                               0x000000010a80e0d4 UIApplicationMain + 159
        20  MyAppz                            0x0000000107195df1 main + 65
        21  libdyld.dylib                       0x000000010cc3a65d start + 1
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException

可能是什么问题,如果需要,我不知道还能显示什么,所以请询问。

【问题讨论】:

    标签: ios xcode cordova firebase


    【解决方案1】:

    您的 GoogleService-Info.plist 文件可能已损坏。 请重新下载并替换它。

    这里的原始讨论 - Firebase for Cordova

    希望这会有所帮助...

    【讨论】:

    • 它是直接来自 FIrebase 的控制台页面,不能损坏或更改
    • 请从 Firebase 控制台重新下载 GoogleService-Info.plist 并替换您的项目 GoogleService-Info.plist 并重试
    • 我遇到了保存问题。有什么想法吗?
    【解决方案2】:

    由于某种原因,Xcode 总是忽略位于项目根目录中的GoogleService-Info.plist,并且没有将其复制到项目的 Resources 文件夹中。

    我在那里手动复制了文件,然后应用程序编译并运行良好。

    【讨论】:

    • 我的情况略有不同。错误是相同的,但我已经有两个 GoogleService-Info.plist 里面 .../Resources 和 /Resources/Resources 这似乎与我的 firebase 配置相同。错过了什么??根目录?如果是的话....根在哪里?因为 xcode 给了我第一个错误:“无法删除 GoogleService.plist ...”
    【解决方案3】:

    在我的情况下,问题在于科尔多瓦复制 GoogleService-Info.plist 并破坏了它。

    所以解决方案是您需要手动完成。 只需从根文件夹中复制您的GoogleService-Info.plist,然后转到 platforms/ios/project-name/Resources 并将其粘贴到那里,然后其中还有另一个 Resources 文件夹也将其粘贴到那里。 platforms/ios/project-name/Resources/Resources

    然后再次尝试构建或在模拟器中运行它,它会正常工作。

    【讨论】:

    • 我错过了Resources/Resources 位置的粘贴操作。
    【解决方案4】:

    另外,当你使用下面的方法时,

    FirebaseApp.configure(name:userName , options: .init(googleAppID: ConfigValues.Firebase.googleAppID, gcmSenderID: ConfigValues.Firebase.gcmSenderID))
    

    确保您提供正确的 googleAppID 和 gcmSenderID,以避免类似的崩溃。

    【讨论】:

      【解决方案5】:

      请从 firebase 重新下载 GoogleService-Info.plist 文件并替换到您的项目中。这解决了我的问题。

      【讨论】:

        猜你喜欢
        • 2018-07-20
        • 1970-01-01
        • 2019-04-15
        • 2020-09-20
        • 1970-01-01
        • 1970-01-01
        • 2016-09-30
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多