How to Change minSdkVersion in Flutter: 2 Simple Approaches

By Mihir Pipermitwala · · 6 min read

âš¡ 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:

  1. Locate the build.gradle File: Navigate to the android/app directory within your Flutter project. Inside this directory, locate and open the build.gradle file using a text editor.

  2. Update the minSdkVersion: Inside the build.gradle file, locate the defaultConfig section. Modify the minSdkVersion field 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:

Copy
defaultConfig {
    applicationId "com.example.common_project"
    minSdkVersion 21 // Update this line
    targetSdkVersion 30
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    // ... other configurations ...
}

Screenshot: Adjusting MinSdkVersion in Flutter for Android - Mihir Pipermitwala

  1. Clean and Re-run: Save the build.gradle file and execute the flutter clean command 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:

  1. Locate the local.properties File: Within your Flutter project, find and open the local.properties file situated in the android directory.

  2. Add the flutter.minSdkVersion Line: Inside the local.properties file, add the following line to set the flutter.minSdkVersion variable:

Copy
flutter.minSdkVersion=21
  1. Verify the build.gradle Reference: Open the build.gradle file located in the android/app directory. Within the defaultConfig section, confirm that minSdkVersion reads the value from local.properties:
Copy
defaultConfig {
    applicationId "com.example.sample_project"
    minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
    targetSdkVersion flutter.targetSdkVersion
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    // ... other configurations ...
}

Screenshot: Adjusting MinSdkVersion in Flutter for Android - Mihir Pipermitwala

  1. Clean and Re-run: As before, save the file and execute the flutter clean command 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 in local.properties (Approach 2) rather than editing Gradle directly.
  • Gradle Kotlin DSL: Some newer projects use android/app/build.gradle.kts instead of build.gradle. The same changes apply; the Kotlin DSL syntax is minSdkVersion = 21 or minSdkVersion = flutter.minSdkVersion.
  • Don’t touch namespace or applicationId when doing this. Since the Android Gradle Plugin 8 era, the package name lives in the namespace declaration at the top of build.gradle and in AndroidManifest.xml, not in defaultConfig. 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.

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.

Mihir Pipermitwala

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 →
Scroll down to load comments...
Related Blogs
Add an MCP Server to Your Flutter/Dart Tooling

Add an MCP Server to Your Flutter/Dart Tooling

Integrate a Model Context Protocol (MCP) server into your Flutter/Dart workflow. Step-by-step setup with Claude Code and real-world use cases.

AI TOOLSMCPFLUTTERDARTDEVELOPER TOOLS

October 06, 2026

Flutter On-Device LLM: Run Gemma & Llama Locally (2026)

Flutter On-Device LLM: Run Gemma & Llama Locally (2026)

Run on-device LLMs in Flutter using gemma_flutter and MediaPipe LLM Inference. No API keys, no internet — real-time AI on Android and iOS.

FLUTTERAI MLON DEVICE LLMGEMMALLAMA

September 24, 2026

How to Change minSdkVersion in Flutter: 2 Simple Approaches

How to Change minSdkVersion in Flutter: 2 Simple Approaches

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.

ANDROIDFLUTTERFLUTTER DEVELOPMENTMIN SDK VERSION

July 20, 2023

Unlocking Flutter's Potential: Best Practices for Writing Clean Code

Unlocking Flutter's Potential: Best Practices for Writing Clean Code

Unlock Flutter's potential with clean code. Learn best practices for writing maintainable Dart code, with examples and essential principles.

CLEAN CODECODE BEST PRACTICESCODE MAINTAINABILITYCODE ORGANIZATIONCODE READABILITY

June 02, 2023

Related Tutorials
A Comprehensive Guide to Flutter Buttons: Choosing the Right One for Your App

A Comprehensive Guide to Flutter Buttons: Choosing the Right One for Your App

Complete guide to Flutter Button widgets. Learn how to use ElevatedButton, TextButton, OutlinedButton, IconButton, CupertinoButton, and FAB with examples.

CUPERTINO BUTTONELEVATED BUTTONFLOATING ACTION BUTTONFLUTTERFLUTTER BUTTON

April 17, 2024

Show an Offline Message for No Internet in Flutter

Show an Offline Message for No Internet in Flutter

You have to use the 'Connectivity Flutter Package' to achieve this feature on your App. This package helps to know whether your device is online or offline.

CONNECTIVITY PLUSDEPENDENCIESFLUTTERFLUTTER DEVELOPMENTFLUTTER PACKAGES

April 09, 2024

Mastering TabBar & TabBarView in Flutter: A Complete Guide

Mastering TabBar & TabBarView in Flutter: A Complete Guide

Implement TabBar and TabBarView in Flutter step by step — customize tab indicators, enable scrollable tabs, and change tabs programmatically.

CODINGDEFAULT TAB CONTROLLERFLUTTERLEARN TO CODETAB CONTROLLER

July 26, 2023

File Manipulation in Flutter: Best Practices & Examples

File Manipulation in Flutter: Best Practices & Examples

Master Flutter file manipulation — permission management, directory handling, and practical read-write scenarios to elevate your app's file handling.

CODINGFLUTTERFLUTTER DEVELOPMENTFLUTTER FILE OPERATIONFLUTTER PATH PROVIDER

June 30, 2023

Related Recommended Services
Visual Studio Code for the Web

Visual Studio Code for the Web

Build with Visual Studio Code, anywhere, anytime, in your browser.

IDEVISUAL STUDIOVISUAL STUDIO CODEWEB
Renovate | Automated Dependency Updates

Renovate | Automated Dependency Updates

Renovate Bot keeps source code dependencies up-to-date using automated Pull Requests.

AUTOMATED DEPENDENCY UPDATESBUNDLERCOMPOSERGITHUBGO MODULES
Best XML Formatter and XML Beautifier

Best XML Formatter and XML Beautifier

Online XML Formatter will format xml data, helps to validate, and works as XML Converter. Save and Share XML.

XMLXML BEAUTIFIERXML CONVERTERXML FORMATXML FORMATTER
Kubecost | Kubernetes cost monitoring and management

Kubecost | Kubernetes cost monitoring and management

Kubecost started in early 2019 as an open-source tool to give developers visibility into Kubernetes spend. We maintain a deep commitment to building and supporting dedicated solutions for the open source community.

CLOUDKUBECOSTKUBERNETESOPEN SOURCESELF HOSTED
Related Recommended Stories
How GitHub reduced testing time for iOS apps with new runner features

How GitHub reduced testing time for iOS apps with new runner features

Learn how GitHub used macOS and Apple Silicon runners for GitHub Actions to build, test, and deploy our iOS app faster.

IOSGITHUBTESTINGRUNNER
5 ways to transform your workflow using GitHub Copilot and MCP

5 ways to transform your workflow using GitHub Copilot and MCP

Learn how to streamline your development workflow with five different MCP use cases.

AGENT MODECODING AGENTCOPILOTFIGMAGITHUB
One weird trick for powerful Git aliases

One weird trick for powerful Git aliases

Advanced Git Aliases

ALIASALIAS TEMPLATEATLASSIANBITBUCKETGIT
Awesome Python

Awesome Python

An opinionated list of awesome Python frameworks, libraries, software and resources

AWESOMEAWESOME PYTHONCOLLECTIONSGITHUBPYTHON
Related Recommended Tools
Find out what websites are built with - Wappalyzer

Find out what websites are built with - Wappalyzer

Find out the technology stack of any website. Create lists of websites and contacts by the technologies they use.

ADD ONSANALYTICSAPP STOREAPPLEBOOKING
Sourcetree | Free Git GUI for Mac and Windows

Sourcetree | Free Git GUI for Mac and Windows

A Git GUI that offers a visual representation of your repositories. Sourcetree is a free Git client for Windows and Mac.

GITGITHUBGITLABATLASSIANBITBUCKET
Related Recommended Videos