'flutter google_mobile_ads reqires higher android SDK version

I want to add google ads to my app. I rearrange pubspec file and AndroidManifest.xml file in android\app\main. but I get error as

The plugin google_mobile_ads requires a higher Android SDK version.
Fix this issue by adding the following to the file
C:\Users\dursu\AndroidStudioProjects\sqlitexample\android\app\build.gradle:

android {                                                                                     
   defaultConfig {                                                                             
     minSdkVersion 19                                                                             }                                                                                           
 }   

when I opened build. gradle file it is like this

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

When I replace minSdVersion flutter.minSdkVersion with 19 I get another crazy error ; Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K.



Solution 1:[1]

uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared [Flutter v2.8.1]

this question was solved here. solution worked for me but why android studio warn user to change sdk 21 instead of 19

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 D. GÜL