Android包冲突等问题
16lz
2021-12-04
Android冲突一般是com.android.support不一致和第三方库的冲突居多,常见解决方法有以下两种
1.统一版本号,在app的build.gradle
```
android {
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group =='com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion'27.0.1'
}
}
}
}
}
```
意思是除了multidex之外com.android.support的包版本都统一设置成27.0.1
2.一般设置统一包版本之后,一般是第三方包冲突,还有studio3.0的问题
首先在Terminal运行(提前设置一下gradle环境)
gradle -q dependencies app:dependencies --configuration compile
查看日志阐述的问题能逐个找到答案比如:
google()低版本不兼容问题,改成
maven { url'https://maven.google.com'}
注意:第三方库多的话,建议一个个查问题,不要把全部不兼容高版本的第三方库导入进去,如果一直报奇怪的错误,先删掉app里.build再同步试下,希望能帮助到大家
更多相关文章
- mybatisplus的坑 insert标签insert into select无参数问题的解决
- Android(安卓)获取包名,版本信息
- Android各个版本API的区别
- Android(安卓)SDK Manager无法下载包的问题
- Android(安卓)多行跑马灯 解决焦点抢占
- Android(安卓)4.0 HttpUrlConnection的getInputStream()方法总是
- 2011.08.15(2)——— android audioManager解决MediaPlayer AudioT
- android中The connection to adb is down .. You must restart a
- mac 下启动Android(安卓)Studio 时出现 Android(安卓)Studio was