8

I have installed the firebase package. as we know minSdkVersion 19 is recommended. So, I wanted to do this process. however, I saw that this line is included in the android/app/build.gradle file

minSdkVersion flutter.minSdkVersion

The previous view would be as follows

minSdkVersion 16

Is it possible to change the version with a file? that is, whether the value for minSdkVersion is split into another file?

Thanks!

2

2 Answers 2

13

Add these lines in your android/local.properties

sdk.dir=/Users/{username}/Library/Android/sdk
flutter.sdk=/Users/{username}/Developer/flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1

flutter.minSdkVersion=21         // new
flutter.targetSdkVersion=30      // new
flutter.compileSdkVersion=30     // new

then in your android/app/build.gradle replace these three lines

    minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
    targetSdkVersion localProperties.getProperty('flutter.targetSdkVersion').toInteger()
    versionCode flutterVersionCode.toInteger()
Sign up to request clarification or add additional context in comments.

2 Comments

worked fine.. but why cant we directly replace it with number (eg: minSdkVersion 16)
How can we find the default value of flutter.minSdkVersion ?
1

Adding

flutter.minSdkVersion=21

to android/local.properties solved the issue for me.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.