Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update minSdkVersion in flutter updated 2.8?

Tags:

flutter

dart

Before updating to Flutter 2.8

defaultConfig {
    applicationId "com.kim.app"
    minSdkVersion 16
    targetSdkVersion 30
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    multiDexEnabled true
}

After updating to Flutter 2.8:

defaultConfig {
        applicationId "com.example.app"
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

How can I update minSdkVersion higher? I cannot find the target "flutter.minSdkVersion" variable anywhere.

like image 523
pckim Avatar asked Mar 02 '26 19:03

pckim


1 Answers

Go to android/local.properties

Add the following ie define the versions

  • flutter.minSdkVersion=21
  • flutter.targetSdkVersion=30
  • flutter.compileSdkVersion=30

Once done goto android/app/build.gradle and add the following

minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()

targetSdkVersion localProperties.getProperty('flutter.targetSdkVersion').toInteger()

Then goto android/build.gradle

Update the Kotlin version

ext.kotlin_version = '1.6.0'

like image 160
Vivek j Avatar answered Mar 06 '26 01:03

Vivek j



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!