android/app/build.gradle
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "cmon.com"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Error:
G:FluttercmonandroidappsrcdebugAndroidManifest.xml Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:cloud_firestore] G:Fluttercmonbuildcloud_firestoreintermediatesmerged_manifestdebugAndroidManifest.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)
FAILURE: Build failed with an exception.
How to modify the above given default versions. What is the reason for this error?
3
Answers
You can manually add the minimum sdk version like this
In an Android Studio project, you have to edit the
build.gradle
file. In a flutter project, it is found at the path./android/app/build.gradle
.The parameter that needs to be changed in minSdkVersion is 19
Android SDK 16-18 is only a Best-effort platforms.
Best-effort means supported through community testing, are platforms we believe we support through coding practices and ad-hoc testing, but rely on the community for testing.
Here is the reference link.
https://docs.flutter.dev/development/tools/sdk/release-notes/supported-platforms#supported-google-tested-platforms
In your android/app/build.gradle flie,
comment this line –
minSdkVersion flutter.minSdkVersion
and just add
minSdkVersion 21
orflutter.minSdkVersion=21