Home > database >  How to detect exceptions in release mode in flutter
How to detect exceptions in release mode in flutter

Time:10-02

My flutter app works fine on debug and profile builds but crashes on release build. I would like to understand why it crashes on release build. Is there any way to see exceptions like I can see in debug mode? It is not enough to see print logs which I can see print logs and does not help. I need to know where and why the app crashes. So it would be helpful if I can see exception logs. I suspect insufficient pro guard rules causes this problem but I don't know which rules should I add more. If I can see exception log, this would help me to add correct rules to pro guard.

CodePudding user response:

Connect your physical device or use any emulator and then run your app using this command flutter run --release from the terminal. You'd be able to view the logs in the release mode

CodePudding user response:

I suggest to use third party tool to track production exceptions. I recommend Sentry (I am not employee, just happy user) as it is easy to configure and works out of the box.

Check https://pub.dev/packages/sentry package and https://sentry.io/ for documentation.

Please note that Sentry works ONLY at production. Also note that if your app crashes, the error is logged next time you try to open the app, and not immediately after the crash.

  • Related