【问题标题】:uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared [Flutter v2.8.1]uses-sdk:minSdkVersion 16 不能小于声明的版本 19 [Flutter v2.8.1]
【发布时间】:2022-01-13 09:46:13
【问题描述】:

我正在尝试将 firebase 添加到我的颤振项目中。 我收到此错误:

uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [com.google.firebase:firebase-analytics-ktx:20.0.1] /home/sonu/.gradle/caches/transforms-2/files-2.1/798243125f1f7594aa48e9bc333d339c/jetified-firebase-analytics-ktx-20.0.1/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="com.google.firebase.analytics.ktx" to force usage (may lead to runtime failures)

我最近将我的颤振更新到了 2.8.1 版本, 我试图改变我的 minSdk 但没有奏效。

这是完整的日志:

[enter image description here][1]

请有人帮我解决这个问题。

【问题讨论】:

标签: firebase flutter


【解决方案1】:

android->app->build.gradle 文件

defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.flutter_calismalari"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

将 minSdkVersion 从 16 变为 21

【讨论】:

  • 错误出现在 gradle 版本中,顺便谢谢!
【解决方案2】:

您需要在 ./android/app/build.gradle 中更新您的最低 SDK 示例:

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.projectname"
    minSdkVersion 19 //*** This is the part that needs to be changed, previously was 16
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

【讨论】:

  • 错误出现在 gradle 版本中,顺便谢谢!
猜你喜欢
  • 2021-03-14
  • 1970-01-01
  • 1970-01-01
  • 2016-09-14
  • 2021-04-10
  • 2021-05-15
  • 1970-01-01
  • 2020-12-31
  • 1970-01-01
相关资源
最近更新 更多