赞
踩
minSdkVersion 16,如图:
接入oaid_sdk_1.0.23.aar后编译不通过,提示:
Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:oaid_sdk_1.0.23:] E:\Android\androidCache\.gradle\caches\transforms-2\files-2.1\56300240547bb0708ea484d8691618a6\oaid_sdk_1.0.23\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.bun.miitmdid" to force usage (may lead to runtime failures)
如图:
打开AndroidManifest.xml文件,加入如下两行代码
根目录: xmlns:tools="http://schemas.android.com/tools"
根目录下方
<uses-sdk tools:overrideLibrary="com.bun.miitmdid"/>
(注意:overrideLibrary后面不能随意加,报错点提示什么就应该填什么,比如我的是:com.bun.miitmdid,如果有多个,它们之间用逗号隔开)
这样就OK了,我手头上没有21以下的手机,无法测试是否会出现异常,为了防止异常,在调用相对应的的aar方法时最好做个版本判断,比如:我的是因为导入的oaid_sdk_1.0.23.aar要求最低版本是21,所以我在调用oaid方法时做个版本判断,如图所示:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。