Flutter Crashlytics 仪表板未显示

flutter crashlytics dashboard not showing

提问人:Sheikh Faizan 提问时间:10/13/2023 最后编辑:Frank van PuffelenSheikh Faizan 更新时间:10/13/2023 访问量:57

问:

enter image description here

-------对于应用级别------

   dependencies {

implementation platform('com.google.firebase:firebase-bom:32.3.1')
implementation("com.google.firebase:firebase-crashlytics")
implementation 'com.google.firebase:firebase-analytics'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

-------对于项目级别------

    dependencies {
    classpath 'com.google.gms:google-services:4.4.0'
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
    classpath 'com.android.tools.build:gradle:7.3.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;
PlatformDispatcher.instance.onError = (error, stack) {
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
return true;
};

添加了所有可能的内容,但仍然没有显示仪表板

安卓 Flutter Firebase Crashlytics

评论


答:

0赞 happyCode 10/13/2023 #1

确保您拥有 FirebaseCrashlytics 的必要导入最新版: 验证主函数是否包含 runZonedGuard 的正确设置:

  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
 runZonedGuarded(() {
    runApp(MyApp());
  }, (error, stackTrace) {
    FirebaseCrashlytics.instance.recordError(error, stackTrace);
  });

  FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
}```

 


Ensure that you have added the necessary dependencies in your pubspec.yaml file replace with latest :>>>
dependencies:
 ` firebase_core: ^2.17.0
  firebase_crashlytics: ^3.3.7`

评论

0赞 Sheikh Faizan 10/13/2023
是的,我正在添加更新的依赖项,但仍然无法解决问题
0赞 Sheikh Faizan 10/13/2023
尝试过,但仍然没有任何反应
0赞 Suraj Gupta 10/13/2023 #2

这通常发生在 Crashlytics 仪表板上。我也发生在我身上。

您应该尝试多次使应用程序崩溃。

另外,请添加 .firebase_crashlytics: ^3.3.4 (latest)

评论

0赞 Sheikh Faizan 10/13/2023
已添加最新firebase_crashlytics: ^3.3.7
0赞 Suraj Gupta 10/13/2023
这行得通吗?
0赞 Suraj Gupta 10/13/2023
另外,您是否添加了 FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
0赞 Sheikh Faizan 10/13/2023
是的,但仍然没有解决