Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MissingPluginException in flutter in release mode android

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

like image 289
Chidhambararajan NRM Avatar asked Oct 20 '25 11:10

Chidhambararajan NRM


1 Answers

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

like image 70
Chidhambararajan NRM Avatar answered Oct 22 '25 02:10

Chidhambararajan NRM