âš¡ TL;DR
Step-by-step guide to change the minSdkVersion in Flutter for Android. Learn how to configure local.properties or build.gradle for both new and old Flutter versions.
Integrating external packages into your app can significantly streamline development, allowing you to focus on your app’s core functionality. However, sometimes this process triggers a requirement to increase the Android minSdkVersion due to the plugin’s demands. This scenario applies to projects created both before and after the Flutter 2.8 update, and the right fix depends on how your project wires Gradle. In this tutorial, I’ll show you how to modify the Android minSdkVersion in Flutter, covering two distinct approaches for different project setups — plus what you need to know about Google Play’s target API requirements in 2025 and beyond.
Ways to Change Android MinSdkVersion in Flutter
Let’s explore the two methods to modify the Android minSdkVersion. The first (hardcoding it in build.gradle) works for any project but is the legacy approach. The second — setting flutter.minSdkVersion in local.properties — is what the modern Flutter template does, and it’s the approach I recommend.
Approach 1: Hardcoding minSdkVersion in build.gradle (Legacy Projects)
For projects created before the Flutter 2.8 update (or projects whose template still hardcodes the value), follow these steps:
Locate the
build.gradleFile: Navigate to theandroid/appdirectory within your Flutter project. Inside this directory, locate and open thebuild.gradlefile using a text editor.Update the minSdkVersion: Inside the
build.gradlefile, locate thedefaultConfigsection. Modify theminSdkVersionfield to match your desired Android API level. For instance, to set the minimum API level to 21 (Android 5.0 - Lollipop), make the adjustment as follows:
defaultConfig {
applicationId "com.example.common_project"
minSdkVersion 21 // Update this line
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// ... other configurations ...
}Screenshot: 
- Clean and Re-run: Save the
build.gradlefile and execute theflutter cleancommand in your terminal. Afterward, re-run your Flutter app.
Approach 2: flutter.minSdkVersion in local.properties (Modern Projects)
Flutter projects scaffolded since the 2.8 era read the SDK versions from local.properties instead of hardcoding them. This is the approach current Flutter templates use, so start here if minSdkVersion flutter.minSdkVersion already appears in your android/app/build.gradle. Here’s how:
Locate the
local.propertiesFile: Within your Flutter project, find and open thelocal.propertiesfile situated in theandroiddirectory.Add the
flutter.minSdkVersionLine: Inside thelocal.propertiesfile, add the following line to set theflutter.minSdkVersionvariable:
flutter.minSdkVersion=21- Verify the
build.gradleReference: Open thebuild.gradlefile located in theandroid/appdirectory. Within thedefaultConfigsection, confirm thatminSdkVersionreads the value fromlocal.properties:
defaultConfig {
applicationId "com.example.sample_project"
minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// ... other configurations ...
}Screenshot: 
- Clean and Re-run: As before, save the file and execute the
flutter cleancommand in your terminal. Then, re-run your Flutter app.
Notes for Modern Flutter Projects (AGP Namespace Era)
A few things have changed since this article was first written that are worth knowing:
- Flutter’s default minSdkVersion has crept up. Recent Flutter releases default to
flutter.minSdkVersion = 24(Android 7.0) in the template. If a plugin needs a higher API level, it will usually tell you in its error message — set that value inlocal.properties(Approach 2) rather than editing Gradle directly. - Gradle Kotlin DSL: Some newer projects use
android/app/build.gradle.ktsinstead ofbuild.gradle. The same changes apply; the Kotlin DSL syntax isminSdkVersion = 21orminSdkVersion = flutter.minSdkVersion. - Don’t touch
namespaceorapplicationIdwhen doing this. Since the Android Gradle Plugin 8 era, the package name lives in thenamespacedeclaration at the top ofbuild.gradleand inAndroidManifest.xml, not indefaultConfig. Changing minSdkVersion doesn’t require touching either. - Minimum works both ways: don’t set minSdkVersion lower than what your plugins declare, or the build will fail with a manifest-merge error telling you the required minimum.
Google Play Target API Requirements (2025 and Beyond)
Raising minSdkVersion is only half the compatibility story. Google Play also enforces a minimum target API level for new apps and updates:
- As of August 31, 2025, new apps and app updates must target Android 15 (API level 35) to be accepted on Google Play (with extensions available for specific cases).
- This bar rises every year in late summer, so check Google’s target API level requirements before each release cycle.
Flutter’s flutter.targetSdkVersion variable tracks this automatically with your Flutter SDK version, which is one more reason to prefer Approach 2 — it keeps targetSdkVersion in sync with the framework instead of pinning it manually.
Conclusion
This tutorial covered adjusting the Android minSdkVersion (flutter.minSdkVersion) in Flutter with two approaches: hardcoding it in build.gradle for legacy projects, and setting flutter.minSdkVersion in local.properties for modern ones. With Play Store target API requirements rising annually, keeping these values driven by your Flutter SDK — rather than hardcoded — saves you a maintenance headache every year.
Curious about other insightful Flutter tutorials? Explore our collection to further enhance your Flutter development expertise.
Related Posts
- A Comprehensive Guide to Flutter Buttons: Choosing the Right One for Your App
- Enhancing File Manipulation in Flutter: Best Practices and Examples
- Flutter Debug Banner Removal: Best Practices and Techniques
- How to Show Automatic Internet Connection Offline Message in Flutter
FAQ
What is minSdkVersion in Flutter Android apps?
minSdkVersion is the lowest Android API level your app supports; devices running older Android versions cannot install or update the app from the Play Store. In Flutter it defaults to the value defined by the Flutter template (recently API 24, Android 7.0), but plugins you add can raise the effective minimum, and you can override it explicitly.
Where do I change minSdkVersion in a Flutter project?
For modern Flutter projects, add a flutter.minSdkVersion line to the android/local.properties file and confirm android/app/build.gradle reads it inside defaultConfig. For legacy projects created before Flutter 2.8, edit the minSdkVersion value directly in android/app/build.gradle. After either change, run flutter clean and rebuild so the new value takes effect.
What happens if a Flutter plugin requires a higher minSdkVersion?
The Android build fails with a manifest-merge error naming the required API level when a plugin needs a higher minimum than your app declares. Fix it by raising your minSdkVersion to at least that level, preferably through local.properties. Setting the value lower than a plugin’s requirement always breaks the build rather than silently degrading functionality.
What is the difference between minSdkVersion and targetSdkVersion in Android?
minSdkVersion sets the oldest Android version your app can be installed on, while targetSdkVersion declares the newest Android behavior your app has been tested against, which the OS uses to decide whether to apply newer restrictions. Google Play separately enforces a minimum targetSdkVersion for updates — Android 15 (API 35) since August 2025.

Written by Mihir Pipermitwala
Senior Full Stack Consultant & Mobile Engineering Specialist building user-focused applications in healthcare with Flutter, Dart and React Native. I write about what I actually build and test — every tutorial here comes from real project work.
More about Mihir →