Сборка имеет тенденцию завершаться сбоем из-за низкой версии minSdk.
Недавно я добавил Firebase cli, конфигурацию Firebase и т. д., чтобы добавить серверную часть в мое приложение, и после всего этого выдала эту ошибку, но она также возникала и в моих предыдущих проектах, где я не использовал Firebase.
Когда я вставьте текст minsdk в файл build.grade, он показывает ошибку и ничего не происходит.
Извините, если я не предоставил полную информацию, так как я впервые пишу вопрос по SO.
Я привожу здесь полное сообщение об ошибке (консоль отладки): -
Код: Выделить всё
Error:
uses-sdk:minSdkVersion 21 cannot be smaller than version 23 declared in library [:firebase_auth] J:\flutter_projects\messaging_app\build\firebase_auth\intermediates\merged_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 21
Suggestion: use a compatible library with a minSdk of at most 21,
or increase this project's minSdk version to at least 23,
or use tools:overrideLibrary="io.flutter.plugins.firebase.auth" 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 21 cannot be smaller than version 23 declared in library [:firebase_auth] J:\flutter_projects\messaging_app\build\firebase_auth\intermediates\merged_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 21
Suggestion: use a compatible library with a minSdk of at most 21,
or increase this project's minSdk version to at least 23,
or use tools:overrideLibrary="io.flutter.plugins.firebase.auth" to force usage (may lead to runtime failures)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────┐
│ The plugin firebase_auth requires a higher Android SDK version. │
│ Fix this issue by adding the following to the file │
│ J:\flutter_projects\messaging_app\android\app\build.gradle: │
│ android { │
│ defaultConfig { │
│ minSdkVersion 23 │
│ } │
│ } │
│ │
│ Following this change, your app will not be available to users running Android SDKs below 23. │
│ Consider searching for a version of this plugin that supports these lower versions of the │
│ Android SDK instead. │
│ For more information, see: │
│ https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration │
└───────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
Подробнее здесь: https://stackoverflow.com/questions/787 ... dle-minsdk
Мобильная версия