7
uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:cloud_firestore]
 D:\doctor_chat\build\cloud_firestore\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16

Suggestion: use a compatible library with a minSdk of at most 16,
    or increase this project's minSdk version to at least 19,
    or use tools:overrideLibrary="io.flutter.plugins.firebase.firestore" to force usage (may lead to runtime failures)

Im getting above error in my code. how to solve this.

enter image description here

enter image description here

Nidew
  • 347
  • 1
  • 7
  • 20

4 Answers4

16

In your app Navigate to android/app/build.gradle and change minsdk from 16 to 21

Here is an image

Hope it will resolve your problem

Ahmad Raza
  • 758
  • 7
  • 26
3

go in your project to android/app/build.gradle file and edit the minSdkVersion to:

minSdkVersion 19
tareq albeesh
  • 1,701
  • 2
  • 10
  • 13
1

Update minSdkVersion 16 to 19 in android/app/build.gradle

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    minSdkVersion 16 // change it to 19 
}
Yashraj
  • 1,025
  • 1
  • 5
  • 22
0

Starting from flutter 2.8 you should change minSdkVersion from android/local.properties

  • I am using flutter 3.10.6 (latest), but there is not any any key `flutter.minSdkVersion` in `local.properties` – Vivek Aug 07 '23 at 13:59