Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug what's wrong if app crashes only in release mode

I upgraded Flutter to 2.0.0 recently and am stuck with this issue. flutter run and flutter run --profile work perfectly well, but flutter run --release makes app crash after startup. There is no stacktrace, there is no error or warning, there is no build issue or verbose warning, no hint really. I googled a lot, but similar questions were answered like "try to remove this line" or "try to add that line". I couldn't find any clear steps on how to debug what's wrong.

What steps should I take to debug this issue and find the root cause instead of trying meaningless changes on code hoping some of them will eventually fix the issue?

like image 515
aleskva Avatar asked Mar 01 '23 16:03

aleskva


1 Answers

Use adb logcat

OR

Enable debugging in release build, by modifying your android/app/build.gradle like this

buildTypes {
    release {
        debuggable true
        shrinkResources false
        minifyEnabled false
        ...
    }
}
like image 123
Hatem Saad Avatar answered Mar 04 '23 08:03

Hatem Saad