Firebase设置后,Flutter ios应用程序崩溃

时间:2019-10-16 09:43:01

标签: firebase flutter

我正在尝试为flutter ios应用程序配置Firebase,我已经下载了GoogleService-Info.plist并将其添加到Xcode的Runner/Runner文件夹中。运行应用程序时,出现此错误

Configuring the default Firebase app...
    "signalStrengthChanged:info:",
    "cellChanged:cell:",
    "connectionStateChanged:connection:dataConnectionStatusInfo:",
    "carrierBundleChange:"
)
    "signalStrengthChanged:info:",
    "cellChanged:cell:",
    "connectionStateChanged:connection:dataConnectionStatusInfo:",
    "carrierBundleChange:"
)
    "signalStrengthChanged:info:",
    "cellChanged:cell:",
    "connectionStateChanged:connection:dataConnectionStatusInfo:",
    "carrierBundleChange:"
)
    "signalStrengthChanged:info:",
    "cellChanged:cell:",
    "connectionStateChanged:connection:dataConnectionStatusInfo:",
    "carrierBundleChange:"
)
Configured the default Firebase app __FIRAPP_DEFAULT.
Lost connection to device.
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010d2161bb __exceptionPreprocess + 331
    1   libobjc.A.dylib                     0x000000010c7b4735 objc_exception_throw + 48
    2   CoreFoundation                      0x000000010d215d29 -[NSException raise] + 9
    3   Runner                              0x0000000104014564 GADApplicationVerifyPublisherInitializedAnalyticsCorrectly + 263
    4   Runner                              0x0000000103fc40f8 GADStatusBarOrientation + 3141
    5   libdispatch.dylib                   0x000000010e42c4e1 _di<…>
Exited (sigterm)

有什么想法我可能会缺少什么?

2 个答案:

答案 0 :(得分:1)

这个问题很可能是由于Info.plist中缺少内容,就像我本人一样。

将以下内容添加到Info.plist

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>

请确保将ca-app-pub-3940256099942544~1458002511替换为您的AdMob ID。

请参见https://firebase.google.com/docs/admob/ios/quick-start

答案 1 :(得分:0)

您是否在firebase_admob中包括了pubspec?如果是,则必须为此调用init方法,或者如果不使用此依赖项,则只需简单地删除它。