im trying to add the cloud_firestore: ^4.8.3 in my flutter project , but when i try to run the project with command flutter run it display to me this error :
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:cloud_firestore] /Users/medyassinemessaoud/Documents/EspritSim/flutter/examples/delivery-1/build/cloud_firestore/intermediates/merged_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 16
such that my build.gradle is like that :
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = 23
}
defaultConfig {
applicationId "com.example.deliveryapp"
minSdkVersion flutterMinSdkVersion
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
also the local.properties is like that :
flutter.compileSdkVersion=23
but same error , how can i fix it
2
Answers
You need to change the minSDK from
The
minSdkVersion
declared in the AndroidManifest.xml file of thecloud_firestore
library is set to 19, while your Flutter project’sminSdkVersion
is set to 16. This conflict occurs because your project’s minimum SDK version is lower than what the library requires.Update your project’s
minSdkVersion
to meet the requirements of thecloud_firestore
library. In yourbuild.gradle
file, change theminSdkVersion
to 19 or higher:If you must maintain a
minSdkVersion
of 16 for your project, you can try using an older version of thecloud_firestore
library that supports SDK 16. You can modify yourpubspec.yaml
file to specify a lower version: