Flutter: Change Android minSdkVersion

Today you will learn how you can easily change the Android minSdkVersion in Flutter for both (Before 2.8 Update and After Flutter 2.8 Update) versions.

Step 1: Find local.properties Folder


Step 2: Add the following lines


Step 3: Open build.gradle file


Step 4: Update minsdkVersion inside defaultConfig section


Step 5: Clean the flutter project

Inside the terminal, run the flutter clean command.

flutter clean

Step 6: Re build you app.

Your Android minSdkVersion will be changed.



flutter.minSdkVersion=21 #here you add the minSdkVersion
How to change local.properties in flutter.
Change local.properties

build.gradle File (android/app/build.gradle)

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.cwh2"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
        // minSdkVersion flutter.minSdkVersion        Old Line
        minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger() //New Line
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
How to change flutter minsdkVersion
Change Flutter minSdkVersion

Project Created Before 2.8 Update

Flutter Change Android minsdkVersion befor Flutter 2.8 update
Before Flutter 2.8 Update

Step 1: Go to the build.gradle file


Step 2: Find defaultConfig and update minSdkVersion

defaultConfig {
    applicationId "com.example.cwh"
    minSdkVersion 21 // This is the value that you update
    targetSdkVersion 30
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName

Step 3: Clean the flutter project

Clean the flutter project by running this command in the command prompt.

flutter clean

Step 4: Re-build your flutter app.

Now your android minSdkVersion will be updated.


Hope you understand the process of changing android minSdkVersion in Flutter. See more

I hope you like this flutter tutorial thanks!

Hussain Humdani

Hussain Humdani

while ( ! ( succeed = try() ) );