gpt4 book ai didi

android - 添加 cloud_firebase 包后,我的 Flutter App 没有运行

转载 作者:行者123 更新时间:2023-12-04 23:46:38 29 4
gpt4 key购买 nike

最近我在我的 flutter 项目中添加了 Firebase。为了使用 firebase 数据库服务,我添加了 cloud_firebase 包。但是在添加这个包之后,我的应用程序没有运行并且给了我一个异常:

BUILD FAILED in 31s
The plugin cloud_firestore requires a higher Android SDK version.
Fix this issue by adding the following to the file C:\Users\Jaguar\Desktop\AppDevelopment\acadmt\android\app\build.gradle:
android {
defaultConfig {
minSdkVersion 19
}
}
Note that your app won't be available to users running Android SDKs below 19.
Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.
Exception: Gradle task assembleDebug failed with exit code 1
异常消息还建议以下建议 :
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)
我已经尝试了前两个建议,但该应用程序仍然无法正常工作。

最佳答案

将 minSdkVersion 更改为 21 后它将起作用。

defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

关于android - 添加 cloud_firebase 包后,我的 Flutter App 没有运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70106952/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com