Android build configuration helps you set up how your Flutter app is built and packaged for Android devices.
Android build configuration in Flutter
android {
compileSdkVersion 33
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 21
targetSdkVersion 33
versionCode 1
versionName "1.0"
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
}
}
}This code is inside the android/app/build.gradle file.
compileSdkVersion is the Android API level used to compile the app.
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 21
targetSdkVersion 33
versionCode 2
versionName "1.1"
}buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}signingConfigs {
release {
storeFile file("my-release-key.jks")
storePassword "password"
keyAlias "my-key-alias"
keyPassword "password"
}
}This is a simple Android build configuration for a Flutter app. It sets the app ID, minimum and target SDK versions, and version info. The release build uses the debug signing config and disables code shrinking.
android {
compileSdkVersion 33
defaultConfig {
applicationId "com.example.myflutterapp"
minSdkVersion 21
targetSdkVersion 33
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
signingConfig signingConfigs.debug
}
}
}Always update versionCode and versionName before releasing a new app version.
Use minSdkVersion to set the lowest Android version your app supports.
Signing configuration is required for publishing your app on the Play Store.
Android build configuration is set in android/app/build.gradle.
It controls app ID, SDK versions, version numbers, and build types.
Proper configuration is important for building and releasing your Flutter Android app.