Flutter app runs in debug buildbut crashes when in release build with no errors and exceptions. Straight crash when opening
So if this happened to you, you might want to consider this.
The problem (for me but it could happen to you) is that I used libraries like ffmpeg_kit_flutter_new and just_audio. Somehow, R8 which is google's code shrinker/obfuscator strips down bridging classes that causes the immidiate crash. App worked on debug because R8 doesn't run in debug.
buildTypes {
release {
signingConfig = signingConfigs.getByName("debug")
isMinifyEnabled = false
}
}
if there's still errors use,
buildTypes {
release {
signingConfig = signingConfigs.getByName("debug")
isMinifyEnabled = false
isShrinkResources = false
}
}
isMinifyEnabled = false -- is the minimal solution
I thought at first it was caused by Impeller but it wasn't. Note, I don't know if this is a permanent fix, though Claude said that a good pro-guard is permanent.