【问题标题】:Firebase iOS SDK Crashing with FIRInstallations validateAppOptions:appNameFirebase iOS SDK 崩溃与 FIRInstallations validateAppOptions:appName
【发布时间】:2020-06-13 10:25:30
【问题描述】:

我正在使用 Firebase 在 Flutter 上开发 iOS 应用,

我的pubsec.yaml 文件有

  firebase_core: 0.4.3+3
  firebase_auth: ^0.14.0+5
  firebase_database: ^3.1.1

以下是我得到的错误,

*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff23c7127e __exceptionPreprocess + 350
    1   libobjc.A.dylib                     0x00007fff513fbb20 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff23c710bc +[NSException raise:format:] + 188
    3   Runner                              0x0000000106000e9f +[FIRInstallations validateAppOptions:appName:] + 799
    4   Runner                              0x00000001060009eb -[FIRInstallations initWithAppOptions:appName:installationsIDController:prefe<…>

【问题讨论】:

    标签: ios firebase flutter firebase-realtime-database


    【解决方案1】:

    您也应该将 apiKey 值添加到 iOS 上的 FirebaseOptions,它对我有用!

    FirebaseApp.configure(
       name: 'name',
      options: Platform.isIOS
          ?  const FirebaseOptions(
              googleAppID: '1:xxxx',
              gcmSenderID: 'xxxx',
              databaseURL: 'https://xxxx.firebaseio.com',
              apiKey:'xxx',
            )
          : const FirebaseOptions(
              googleAppID: '1:xxx',
              apiKey: 'xxx',
              databaseURL: 'https://xx.firebaseio.com',
            )
    );
    

    【讨论】:

    • 您应该包含一个代码 sn-p 或您的解决方案示例。
    【解决方案2】:

    很可能是您需要将 GoogleServices-Info.plist 从控制台更新到应用程序。

    来源https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseInstallations/Source/Library/FIRInstallations.m#L122中的完整详细信息

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-10
      相关资源
      最近更新 更多