更新:uses-sdk:minSdkVersion 16 不能小于库 [:cloud_firestore] 中声明的版本 19

Asw*_*n B 2 android firebase firebase-authentication flutter google-cloud-firestore

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
    }
Run Code Online (Sandbox Code Playgroud)

错误:

G:\Flutter\cmon\android\app\src\debug\AndroidManifest.xml Error:
    uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:cloud_firestore] G:\Flutter\cmon\build\cloud_firestore\intermediates\merged_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)

FAILURE: Build failed with an exception.
Run Code Online (Sandbox Code Playgroud)

如何修改上面给出的默认版本。出现这个错误的原因是什么?

Kau*_*dru 5

您可以像这样手动添加最低sdk版本

defaultConfig {
        applicationId "cmon.com"
        minSdkVersion 21
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }
Run Code Online (Sandbox Code Playgroud)