Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk

今天在集成三方SDK是出现**Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:device_sdk-release:]**详细信息如下:
Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:device_sdk-release:] C:\Users\geo\.gradle\caches\transforms-1\files-1.1\device_sdk-release.aar\e529280690e69043be9b8f9fc1e329c8\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="xxx" to force usage (may lead to runtime failures)
在这里插入图片描述

原因

造成这种问题的原因是自己项目的minSdkVersion比三方SDK的的minSdkVersion低,即版本不一致导致的。

解决办法

其实在上面的日志中也给出了这种问题的三种解决方案:

  1. Suggestion: use a compatible library with a minSdk of at most 16:将三方库的minSdkVersion
    降低,这种方案一般是不可行,我们自己无法修改对方的SDK的minSdkVersion。
  2. increase this project's minSdk version to at least 19:提高自己项目的minSdkVersion大于等于三方的即可。
  3. use tools:overrideLibrary="com.android.device.geo.device_sdk" to force usage :在AndroidMainifest.xml中加入下面加上:
    <uses-sdk tools:overrideLibrary="三方库的包名"/>即可。

猜你喜欢

转载自blog.csdn.net/weixin_37639900/article/details/90261211