Android 开发问题:uses-sdk:minSdkVersion 21 cannot be smaller than version 24 declared in library
·
问题与处理策略
问题描述
Error: uses-sdk:minSdkVersion 21 cannot be smaller than version 24 declared in library [:common]
Suggestion:
use a compatible library with a minSdk of at most 21,
or increase this project's minSdk version to at least 24,
or use tools:overrideLibrary="com.sunke.common" to force usage (may lead to runtime failures)
# 翻译
错误:
当前模块的 minSdkVersion(21)不能低于引用的库 [:common] 中声明的 minSdkVersion(24)
建议:
1. 使用一个 minSdk ≤ 21 的兼容库
2. 将当前项目的 minSdk 提升到至少 24
3. `tools:overrideLibrary="com.my.common"` 强制使用(但可能导致运行时崩溃)
问题原因
-
主模块声明了
minSdkVersion为 21,但是,引用的模块声明了minSdkVersion为 24 -
Android 要求主模块的
minSdkVersion不能低于任何引用的模块的minSdkVersion,为了防止运行时崩溃
处理策略
-
升级主模块的
minSdkVersion -
或者,降级引用的模块的
minSdkVersion
更多推荐
所有评论(0)