Many plugins aren't working in flutter when you try to build a apk in release mode , but these plugins are working perfectly in debug mode
Some recomend changing the gradle version to 3.5 , but sometimes the plugins used may not be compatible with the same like file_picker_cross
Others recomend using --no-shrink
option while building the apk i.e flutter build apk --release --no-shrink
None of that solutions worked for me , i found this solution burried in a github issue conversation
Check the solution below
Looks like the recent proguard rules in flutter is ejecting the plugins which arent registering properly
In your project's app/build.gradle
change
buildTypes {
release {
signingConfig signingConfigs.release
}
}
to
buildTypes {
release {
shrinkResources false
minifyEnabled false
signingConfig signingConfigs.release
}
}
The added extra 2 lines seems to skip the proguard rules part thereby saving your from the nightmare , this is just a temporary work around , there might be a fix soon from flutter
Ofcourse this skips the proguard optimization , but atleast the code works now ;)
I have been wasting my time for almost 6 hours without knowing the solution ,so I am posting it here for others
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With