pckim
pckim

Reputation: 165

How to update minSdkVersion in flutter updated 2.8?

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.

Upvotes: 12

Views: 8748

Answers (4)

Sanskar Jain
Sanskar Jain

Reputation: 13

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

Upvotes: -1

Vivek j
Vivek j

Reputation: 191

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'

Upvotes: 19

Dipak Prajapati
Dipak Prajapati

Reputation: 380

just replace flutter.minSdkVersion with your value ,

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

Upvotes: 13

rickimaru
rickimaru

Reputation: 2490

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

Upvotes: 7

Related Questions