Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android minSdkVersion with Flutter(v2.8.1)

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!

like image 576
Rustam Usmanov Avatar asked Jun 15 '26 11:06

Rustam Usmanov


1 Answers

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()
like image 115
Abdullah Avatar answered Jun 17 '26 01:06

Abdullah



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!