【问题标题】:No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp() [duplicate]没有创建 Firebase 应用“[DEFAULT]”-调用 Firebase.initializeApp() [重复]
【发布时间】:2020-12-24 22:26:12
【问题描述】:

我已经更新了我的 Firebase 软件包。

firebase_auth: ^0.18.0+1
  cloud_functions: ^0.6.0
  firebase_crashlytics: ^0.1.4+1
  cloud_firestore: ^0.14.0+2
  firebase_storage: ^4.0.0
  firebase_core: ^0.5.0
  firebase_messaging: ^7.0.0

更新后出现此错误。

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (20050): The following FirebaseException was thrown building _InheritedProviderScope<FeedbackAnswer>(value:
I/flutter (20050): <not yet loaded>):
I/flutter (20050): [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()

使用后

Firebase.initializeApp(options: FirebaseOptions(
    appId: 'xyzzy',
    projectId: 'zzzz',
    apiKey: 'zzzz',
    messagingSenderId: 'zzz',
  ),name: "Rapport");

我收到 2 个错误 首先是

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (20050): The following FirebaseException was thrown building _InheritedProviderScope<FeedbackAnswer>(value:
I/flutter (20050): <not yet loaded>):
I/flutter (20050): [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()

我猜第二个是警告

W/ConnectivityManager.CallbackHandler(20050): callback not found for CALLBACK_AVAILABLE message
I/flutter (20050): firebase_crashlytics: Error reported to Crashlytics.
E/flutter (20050): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: [core/duplicate-app] A Firebase App named "Rapport" already exists
E/flutter (20050): #0      MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:97:7)

请帮我解决这个问题。

【问题讨论】:

    标签: firebase flutter


    【解决方案1】:

    请确保您已经按照this link 中的说明导入了GoogleService-Info.plist
    另外,请尝试flutter clean 并在模拟器或手机中再次启动。

    【讨论】:

      猜你喜欢
      • 2020-04-30
      • 2021-12-29
      • 2020-05-21
      • 2020-12-12
      • 2021-04-10
      • 1970-01-01
      相关资源
      最近更新 更多