您的位置:首页 > 其它

uses-sdk tools:overrideLibrary uses-sdk:minSdkVersion 1 cannot be smaller than version 9

2017-05-03 17:51 916 查看
android studio 使用第三方库合并出现minSdkVersion 问题问题一:Error:Execution failed for task ':app:processDebugManifest'.> Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 21declared in library [gr.escsoft.michaelprimez.revealedittext:RevealEditText:1.0.1] C:\Users\Administrator\.android\build-cache\d5a100f0a9d8dc264876d9eb481e72ab39cc7f96\output\AndroidManifest.xmlSuggestion: use tools:overrideLibrary="gr.escsoft.michaelprimez.revealedittext" to force usage解决方法:在库或者主app中的AndroidManifest.xml下边
application的外部上边追加一句话
<uses-sdk
xmlns:tools="http://schemas.android.com/tools"
tools:overrideLibrary="gr.escsoft.michaelprimez.revealedittext"/>
这样就能编译通过,但是!!!!!!
没经过测验,个人觉得最好不要这样做,容易导致版本不兼容问题,例如库lib兼容到21,而目前最低14主app中,如果用户手机版本低于5.0版本,例如4.x版本,
有可能不兼容,
而出现能安装上app,但是使用到了具体lib中的功能时,出现崩溃问题,所以,还是选择兼容的app库再使用
问题二:
Error:Execution failed for task ':library:processDebugAndroidTestManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 9 declared in library [com.android.support:appcompat-v7:25.3.1] C:\Users\Administrator\.android\build-cache\d3a75efec7269e1cd4cfddcc4a1fb98086bc9fad\output\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="android.support.v7.appcompat" to force usage
这个解决方法:很简单,像
AndroidManifest.xml下边
application的外部上边追加一句话
<uses-sdk android:minSdkVersion="9"/>
或者
gradle下边增加:( 根据自己的需求,配置红色部分
android {
compileSdkVersion 25
buildToolsVersion = '25.0.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 21
versionName "3.2.4"
}
}

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐