Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter app show grey screen in release mode but works fine in debug mode

I am trying out flutter and currently following this tutorial https://www.youtube.com/watch?v=j6c_vHdbUfg

I notice that the app works fine in debug mode but when I try the apk on my phone the app shows a grey screen after the loading screen. I am not too familiar building apps on mobile and not sure what is causing the issue here. I've tried building the apk using the github project from the tutorial but it also have this issue. https://github.com/iamshaunjp/flutter-beginners-tutorial/tree/lesson-35

like image 680
Tan Yik Fung Avatar asked Dec 27 '19 14:12

Tan Yik Fung


People also ask

How do I run the flutter app in profile mode in VS code?

Now when you press F5 to launch the application, the corresponding launch mode will be used. By default, when running in profile mode memory usage will automatically be shown on the status bar.


Video Answer


1 Answers

It's a Flutter crash.

I had the same issue and solved it by installing SENTRY error logging in my flutter project. It takes me for 30 minutes for installing and fixing :)

Here is a link to flutter official documentation about SENTRY: https://flutter.dev/docs/cookbook/maintenance/error-reporting

P.S. Also watch carefully for imports while installing, because you can have dart:html error. see: Flutter build cannot find 'dart:html'

P.P.S Make sure you app have access to the internet in AndroidManifest.xml if you installing SENTRY

<manifest xlmns:android...>
 ...
 <uses-permission android:name="android.permission.INTERNET" />
 <application ...
</manifest>

Good luck!

like image 116
Ilia vialikov Avatar answered Sep 29 '22 13:09

Ilia vialikov