1

I am trying to install crashlytics in Flutter app, and I can get the error/crash in the Firebase console. after forcing a crash in my main function like this

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();

  FirebaseCrashlytics.instance.crash(); // forcing a crash, in line 5

  runApp(MyApp());
}

the error in console looks like this

enter image description here

it seems to me that the error is still in Java. I can't identify the error if it still pointing to the java code. I need to know the error position in my dart code. like for example above, it should indicate that error is in main.dart file in line 5. In native Android and native iOS usually it will be like that

am I missing something? is the default like that?

Alexa289
  • 8,089
  • 10
  • 74
  • 178
  • But isn't this a deliberate crash? It says that it was caused by calling .crash(). There isn't anything wrong with the code. – Huthaifa Muayyad Aug 22 '21 at 03:48
  • Firebase crashlytics 'crash' causes the app to crash natively. It does not occur in the Flutter engine. Try throwing a fatal exception in Dart and see the output in the crashlytics console. – Lee3 Aug 22 '21 at 03:49

0 Answers0