flutter uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library

Launching lib/main.dart on 21091116C in debug mode...
Running Gradle task 'assembleDebug'...
/Users/oldwei/IdeaProjects/stone/android/app/src/debug/AndroidManifest.xml Error:
	uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:im_flutter_sdk] /Users/oldwei/IdeaProjects/stone/build/im_flutter_sdk/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 21,
		or use tools:overrideLibrary="com.easemob.im_flutter_sdk" 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 with multiple errors, see logs

* 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 16s

┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────┐
│ The plugin im_flutter_sdk requires a higher Android SDK version.                              │
│ Fix this issue by adding the following to the file                                            │
/Users/oldwei/IdeaProjects/stone/android/app/build.gradle:android {                                                                                     │
defaultConfig {                                                                             │
│     minSdkVersion 21│   }                                                                                           │
│ }                                                                                             │
│                                                                                               │
│ Note that your app won't be available to users running Android SDKs below 21.│ Alternatively, try to find a version of this plugin that supports these lower versions of the │
│ Android SDK.                                                                                  │
│ For more information, see:│ https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration                 │
└───────────────────────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1

关于flutter的uses-sdk:minSdkVersion的问题,请修改$flutterRoot/packages/flutter_tools/gradle/flutter.gradle文件中的static int minSdkVersion = 21

posted @   老卫同学  阅读(421)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术
点击右上角即可分享
微信分享提示
主题色彩