Android 日常报错之 Android dependency 'com.android.support:support-v4' has different version
16lz
2021-01-23
Caused by: java.lang.RuntimeException: Android dependency 'com.android.support:support-v4' has different version for the compile (26.1.0) and runtime (27.1.0) classpath. You should manually set the same version via DependencyResolution
- 问题描述:多个模块引用了不同版本的com.android.support:support-v4,需要我们手动统一版本
- 查看各版本的Library依赖详情
./gradlew :app:dependencies./gradlew -q dependencies :dependencies --configuration compile
- 解决办法
android { configurations.all { resolutionStrategy.force "com.android.support:support-v4:27.1.0" }}
- 如果rebuild之后还有如下错误:
Caused by: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
疯狂在网上找答案,有无数种解答,我的报错原因是自己代码的问题,依赖库进行了升级,在做implement的时候多了一个已经被移除的方法,将改方法的实现删除即可。
更多相关文章
- Android软键盘弹出不影响布局的方法
- Android 实现图片轮播的三种方法
- Android最新版本号与API级别对应关系
- Android三种实现定时器的方法
- Android 强制停止RecyclerView滑动方法
- NDK各版本下载
- android studio SDK版本的调节
- Android 禁止转屏的方法
- android应用去掉title bar 及全屏处理方法