Change Android Minsdkversion flutter.minsdkversion) in Flutter

For the Projects Created After Flutter 2.8 Update

To change Android minSdkVersion in Flutter for the project created after the 2.8 update, you have to make changes in the file and then reference the new variable from the file inside the build.gradle file. 

Here are the steps:

  1. Locate the file under the project_folder/android/
  2. Inside the file, add the line as flutter.minSdkVersion=21
  3. Now, open the build.gradle file under the project_folder/android/app/build.gradle
  4. Find the defaultConfig section update the minSdkVersion to the localProperties.getProperty(‘flutter.minSdkVersion’).toInteger().
  5. Inside the terminal, run the flutter clean command.
  6. Re-run your app.