首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >颤振启动错误:使用-sdk:minSdkVersion 16不能小于在库中声明的版本19

颤振启动错误:使用-sdk:minSdkVersion 16不能小于在库中声明的版本19
EN

Stack Overflow用户
提问于 2022-08-29 13:43:45
回答 1查看 318关注 0票数 1

我已经尝试将minSdkVersion从16改为19和21 (就像颤振提示的那样,这是对终端问题的修正)。我还试着让flutter.create重新构建安卓文件夹。我完全重新安装了颤音。我还将我的compileSdkVersion从32更改为31,并对targetSdkVersion做了同样的事情。但错误仍在发生。

完全错误:

代码语言:javascript
运行
复制
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
C:\Flutter\test_project\android\app\src\debug\AndroidManifest.xml Error:
    uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:cloud_firestore] C:\Flutter\test_project\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.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:cloud_firestore] C:\Flutter\test_project\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)

BUILD FAILED in 21s
//Flutter Fix
Exception: Gradle task assembleDebug failed with exit code 1

My android {} in build.gradle(app):

代码语言:javascript
运行
复制
android {
    compileSdkVersion 31
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        applicationId "com.example.test_app"
        multiDexEnabled = true
        minSdkVersion 21
        targetSdkVersion 31
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-08-30 05:30:44

将库中的firebase.firestore插件minSdkVersion 16改为19将解决错误

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73529803

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档