12

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.

1

4 Answers 4

19

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'

Sign up to request clarification or add additional context in comments.

2 Comments

It's not working
worked like a charm for my case. thank you
15

just replace flutter.minSdkVersion with your value ,

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

Comments

7

Just replace flutter.minSdkVersion to your target version.

flutter.minSdkVersion is found in https://github.com/flutter/flutter/blob/stable/packages/flutter_tools/gradle/flutter.gradle

Comments

-1

Go to android/local.properties there you can change configuration

1 Comment

This didn't work for me so i'm giving it a down vote.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.