没有firebase应用程序' [默认]':for'add添加到app'使用Firebase_crashlytics flutter应用程序

发布于 2025-02-13 18:09:39 字数 2514 浏览 3 评论 0 原文

tldr;

我们如何使用FlutterFire配置Firebase Crashlytics for 我已经看到了其他stackoverflow问题,并且尝试了这些选项

更长的版本:

  • parent应用程序,没有任何firebase插件和firebase.initialize()调用。它只是指儿童应用程序应用
  • 程序中的“儿童包”应用程序,我们有消防基础插件并初始化呼叫。
  • 如果您对我们的设置感到好奇,则它可以在
  • 在Child的Main.dart文件中,我们有以下代码
    void main() {
      runZonedGuarded(() async {
        // Initialize Flutter bindings; must come first!
        WidgetsFlutterBinding.ensureInitialized();
        await Firebase.initializeApp(
        );
        ... 

调用堆栈看起来像

[VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()
#0      MethodChannelFirebase.app (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:193:5)
#1      Firebase.app (package:firebase_core/src/firebase.dart:53:41)
#2      FirebaseCrashlytics.instance (package:firebase_crashlytics/src/firebase_crashlytics.dart:33:55)
#3      main.<anonymous closure> (package:package/main.dart:58:25)
#4      _rootRunBinary (dart:async/zone.dart:1450:47)
#5      _CustomZone.runBinary (dart:async/zone.dart:1342:19)
#6      runZonedGuarded.<anonymous closure> (dart:async/zone.dart:1832:18)
#7      _Zone._processUncaughtError (dart:async/zone.dart:1109:14)
#8      _CustomZone.handleUncaughtError (dart:async/zone.dart:1312:5)
#9      Future._propagateToListeners (dart:async/future_impl.dart:680:16)
#10     Future._completeError (dart:async/future_impl.dart:574:5)
#11     _completeOnAsync<…>

Firebase 1.5.0都很好,但是我不得不升级crashlytics

包装中的casslytics更改

到目前为止我尝试过的

  1. 是生成文件firebase_options.dart文件FlutterConfigure并通过以下语法从孩子那里参考它
 await Firebase.initializeApp(
      options: DefaultFirebaseOptions.currentPlatform,
    );
  1. 也试图给出 name 参数,但这也无济于事。

问题是,[默认]项目在哪里引用?如何删除/编辑?

TLDR;

How can we configure firebase crashlytics with flutterfire for Add to App
I've seen other stackoverflow questions and tried those options already

Longer version:

  • Parent app, doesn't have any firebase plugins nor firebase.initialize() calls. It just refers to the child package app
  • In the child app we have fire base plugins and initialize calls.
  • If you are curious about our setup, its on medium.
  • In child's main.dart file we have the following code
    void main() {
      runZonedGuarded(() async {
        // Initialize Flutter bindings; must come first!
        WidgetsFlutterBinding.ensureInitialized();
        await Firebase.initializeApp(
        );
        ... 

Call stack looks like this

[VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()
#0      MethodChannelFirebase.app (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:193:5)
#1      Firebase.app (package:firebase_core/src/firebase.dart:53:41)
#2      FirebaseCrashlytics.instance (package:firebase_crashlytics/src/firebase_crashlytics.dart:33:55)
#3      main.<anonymous closure> (package:package/main.dart:58:25)
#4      _rootRunBinary (dart:async/zone.dart:1450:47)
#5      _CustomZone.runBinary (dart:async/zone.dart:1342:19)
#6      runZonedGuarded.<anonymous closure> (dart:async/zone.dart:1832:18)
#7      _Zone._processUncaughtError (dart:async/zone.dart:1109:14)
#8      _CustomZone.handleUncaughtError (dart:async/zone.dart:1312:5)
#9      Future._propagateToListeners (dart:async/future_impl.dart:680:16)
#10     Future._completeError (dart:async/future_impl.dart:574:5)
#11     _completeOnAsync<…>

All was well with firebase 1.5.0 but I had to upgrade for crashlytics

Change in packages
enter image description here

So far what I have tried

  1. Generate the file firebase_options.dart file from flutterconfigure and refer to it from the child with following syntax
 await Firebase.initializeApp(
      options: DefaultFirebaseOptions.currentPlatform,
    );
  1. Also tried to give name parameter but that didn't help either.

Question is where is the [DEFAULT] project being referenced and how can I remove/edit it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

彩虹直至黑白 2025-02-20 18:09:39

本期应使用 firebase_core 以及您可能使用的任何其他Flutterfire套件的最新版本解决此问题。在您的项目中。

This issue should be fixed with the latest version of firebase_core and any additional flutterfire packages you might be using in your project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文