0

In the old version, we could change it via android/app/build.gradle. Now it gives an error when we change it.

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

There are those who fix this problem via local.properties, but this method does not work either.

sdk.dir=C:/Users/user/AppData/Local/Android/Sdk
flutter.sdk=C:\\src\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
regenin
  • 291
  • 9
  • 18
  • 1
    Does this answer your question? [How to change Android minSdkVersion in flutter project](https://stackoverflow.com/questions/52060516/how-to-change-android-minsdkversion-in-flutter-project) – Jahidul Islam Dec 20 '21 at 19:57

1 Answers1

1

you need to edit the build.gradle file in the new version as well. As follows;

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
   applicationId "com.example.manuel"
    minSdkVersion 16 // <--- There minSdkVersion Content
    targetSdkVersion 27 <--- There targetSdkVersion (is actually Max Sdk Version) Content
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

then rebuild the project and build it again.

I hope that will be useful.

alierguc
  • 67
  • 4