所有com.android.support库都必须使用完全相同的版本规范

Firebase引用版本冲突解决:Android dependency 'com.google.android.gms:play-services-basement' has different 前两天在RN项目中集成原生的firebase,之后报错插件版本冲突,报错信息如下: What went wrong: Execution failed for task ‘:app:preDebugBuild’. Android dependency ‘com.google.android.gms:play-services-basement’ has different version f... 阅读详情

本文翻译自:All com.android.support libraries must use the exact same version specification

After updating to android studio 2.3 I got this error message. 更新到android studio 2.3后,我收到此错误消息。 I know it's just a hint as the app run normally but it's really strange. 我知道这只是应用正常运行的提示,但确实很奇怪。

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). 所有com.android.support库都必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。 Found versions 25.1.1, 24.0.0. 找到版本25.1.1,24.0.0。 Examples include com.android.support:animated-vector-drawable:25.1.1 and com.android.support:mediarouter-v7:24.0.0 示例包括com.android.support:animated-vector-drawable:25.1.1和com.android.support:mediarouter-v7:24.0.0

在此处输入图片说明

my gradle: 我的gradle:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:25.1.1'
    compile 'com.android.support:support-v4:25.1.1'
    compile 'com.android.support:design:25.1.1'
    compile 'com.android.support:recyclerview-v7:25.1.1'
    compile 'com.android.support:cardview-v7:25.1.1'
    compile 'com.google.android.gms:play-services-maps:10.2.0'
    compile 'com.google.android.gms:play-services:10.2.0'

    compile 'io.reactivex.rxjava2:rxjava:2.0.1'
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
    compile 'com.jakewharton:butterknife:8.4.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
    compile 'com.blankj:utilcode:1.3.6'
    compile 'com.orhanobut:logger:1.15'
    compile 'com.facebook.stetho:stetho:1.4.2'

    provided 'com.google.auto.value:auto-value:1.2'
    annotationProcessor 'com.google.auto.value:auto-value:1.2'
    annotationProcessor 'com.ryanharter.auto.value:auto-value-parcel:0.2.5'

    compile 'com.mikepenz:iconics-core:2.8.2@aar'
    compile('com.mikepenz:materialdrawer:5.8.1@aar') { transitive = true }
    compile 'com.mikepenz:google-material-typeface:2.2.0.3.original@aar'
    compile 'me.zhanghai.android.materialprogressbar:library:1.3.0'
    compile 'com.github.GrenderG:Toasty:1.1.1'
    compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.8.0'
    compile 'com.github.MAXDeliveryNG:slideview:1.0.0'

    compile 'com.facebook.fresco:fresco:1.0.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'

    compile 'com.google.maps.android:android-maps-utils:0.4.4'
    compile 'com.github.jd-alexander:library:1.1.0'
}

#1楼

参考:https://stackoom.com/question/2rnS3/所有com-android-support库都必须使用完全相同的版本规范


#2楼

You have defined any other dependency to compile with version 24.0.0 instead of 25.1.1 . 您已经定义了任何其他依赖项,以使用版本24.0.0而不是25.1.1进行编译。 Please set all dependencies version the same as 25.1.1 . 请设置所有依赖项版本与25.1.1相同。


#3楼

You can solve this with one of the following solutions: 您可以使用以下解决方案之一解决此问题:

Update: 更新:

As of Android studio 3.0, it becomes much easier as it now shows a more helpful hint, so we only need to follow this hint. 从Android Studio 3.0开始,它变得更加容易,因为它现在显示了一个更有用的提示,因此我们只需要遵循此提示即可。
for example: 例如: 1]

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). 所有com.android.support库都必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。 Found versions 27.0.2, 26.1.0. 找到版本27.0.2、26.1.0。 Examples include com.android.support:animated-vector-drawable:27.0.2 and com.android.support:customtabs:26.1.0 示例包括com.android.support:animated-vector-drawable:27.0.2和com.android.support:customtabs:26.1.0

there are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. 某些库,工具或库的组合不兼容或可能导致错误。 One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion.) 一种不兼容的情况是使用不是最新版本的Android支持库版本进行编译(或者特别是低于目标targetSdkVersion的版本)。

Solution: 解:
Add explicitly the library with the old version but with a new version number. 显式添加具有旧版本但具有新版本号的库。
in my case com.android.support:customtabs:26.1.0 so I need to add: 就我而言com.android.support:customtabs:26.1.0所以我需要添加:

implementation "com.android.support:customtabs:27.0.2"  

ie: Take the library from the second item, and implement it with the version number from the first. 即:从第二项中获取库,并使用第一项中的版本号实现它。

Note: don't forget to press sync now so gradle can rebuild the dependency graph and see if there are any more conflicts. 注意:请不要忘记立即按sync,以便gradle可以重建依赖关系图并查看是否还有更多冲突。

Explanation: 说明:
you may be confused by the error message as don't use customtabs so how I have a conflict!! 错误消息可能会使您感到困惑,因为不使用customtabs所以我会有冲突!!
well.. you didn't use it directly but one of your libraries uses an old version of customtabs internally, so you need to ask for it directly. 很好..您没有直接使用它,但是您的一个库在内部使用了旧版本的customtabs ,因此您需要直接要求它。

if you curious to know which of your libraries is responsible for the old version and maybe ask the author to update his lib, Run a Gradle dependency report, see the old answer to know how. 如果您想知道哪个库是旧版本的原因,并且可能要求作者更新他的库(运行Gradle依赖性报告),请参阅旧答案以了解具体方法。

Note this 注意这个


Old answer: 旧答案:

inspired by CommonsWare answer : 受CommonsWare的启发答案 :

Run a Gradle dependency report to see what your full tree of dependencies is. 运行Gradle依赖性报告以查看完整的依赖性树是什么。

From there, you will see which one of your libraries are asking for a different version of the Android Support libraries. 从那里,您将看到您的哪个库要求使用其他版本的Android支持库。 For whatever it is asking for, you can ask for it directly with the 25.2.0 version or use Gradle's other conflict resolution approaches to get the same versions. 无论要求什么,您都可以直接在25.2.0版本中要求它,或者使用Gradle的其他冲突解决方法来获得相同的版本。


Update: 更新:

As of gradle plugin version: 3.0 compile has been replaced by implementation or api see this answer for the difference. 从gradle插件版本开始:3.0 compile已被implementation或api取代,请参阅此答案以了解区别。

hence use instead: 因此改用:

./gradlew -q dependencies app:dependencies --configuration debugAndroidTestCompileClasspath

or for windows cmd: 或对于Windows cmd:

gradlew -q dependencies app:dependencies --configuration debugAndroidTestCompileClasspath

and search for the conflicted version. 并搜索有冲突的版本。

For me, the error disappeared after removing com.google.android.gms:play-services:10.2.0 对我来说,删除com.google.android.gms:play-services:10.2.0后,错误消失了

And only include com.google.android.gms:play-services-location:10.2.0 and com.google.android.gms:play-services-maps:10.2.0 as they are the only two play services that I use. 并且仅包含com.google.android.gms:play-services-location:10.2.0和com.google.android.gms:play-services-maps:10.2.0因为它们是我使用的仅有的两个播放服务。

I think the gms:play-services depend on some old components of the support library, so we need to add them explicitly ourselves. 我认为gms:play-services依赖于支持库的某些旧组件,因此我们需要自己明确添加它们。


for AS 3.0 an older. 对于AS 3.0或更早的版本。

Run: 跑:

./gradlew -q dependencies <module-name>:dependencies --configuration implementation

Example: 例:

./gradlew -q dependencies app:dependencies --configuration implementation

if someone knows a better way in the new gradle plugin please let me know. 如果有人知道新的Gradle插件中有更好的方法,请告诉我。


#4楼

打开项目的外部库,您会看到一些库仍在使用以前的版本,尽管您没有提到这些库,所以我的建议是仅使用特定库的版本来解决您的问题。


#5楼

  1. Go to project/.idea/libraries folder on your file system and see which libraries are different. 转到文件系统上的project/.idea/libraries文件夹,查看哪些库不同。
  2. You will have to manually include these libraries with the same version in your build.gradle file. 您将必须在build.gradle文件中手动包含具有相同版本的这些库。
  3. Then, sync your project. 然后,同步您的项目。

Eg: 例如:

compile 'com.android.support:appcompat-v7:25.2.0'

// Wrong library version found on 1st point
compile 'com.android.support:customtabs:25.2.0'

#6楼

I had the exact same problem after updating to Android Studio 2.3 更新到Android Studio 2.3之后,我遇到了完全相同的问题

Adding this line to dependencies solved my problem: 将此行添加到依赖项解决了我的问题:

compile 'com.android.support:customtabs:25.2.0'
Android源码中com.android.support依赖迁移到AndroidX库 1.Google(谷歌)2018 IO 大会推出了 Android新的扩展库 AndroidX,用于替换原来的 Android扩展库,将原来的android替换成androidx;只有包名和Maven工件名受到影响,原来的类名,方法名和字段名不会更改。官方早就推荐将support库迁移到androidx,因为后续support库不会再做更新2.AndroidX是对android.support.xxx包的整理后产物。由于之前的support包过于混乱,所以,Google推出了AndroidX。 阅读详情

相关推荐

aapt问题,compileSdkVersion、buildToolsVersion、buildToolsVersion、 com.android.support:appcompat-v7版本问题

aapt问题:注意你的用户名不要中文,项目中不要中文。 aapt 是Android Asset Packaging Tool的缩写,是编译和打包资源的工具。而aapt2是在aapt上做了优化。Android Gradle Plugin 3.0.0或者更高版本默认开启aapt2。当然也可以在配置文件中手动关闭aapt2。 一般打包过程情况下,都是由gradle自动调用aapt2,将资源文件...

ZhangJiqun&191cm&85kg 693

com.android.support版本冲突的解决办法

com.android.support版本冲突的解决办法

QG 2663

深入Android构建系统:一次修改ro.vendor.build.fingerprint失败的排查与解决记录

本文深入探讨了Android构建系统中修改ro.vendor.build.fingerprint的完整解决方案。通过分析vendor分区的特殊地位和构建指纹的生成路径,提供了三种实战修改方法,并揭示了指纹修改可能遇到的陷阱与对策,帮助开发者彻底解决这一常见问题。

weixin_30621711的博客 164

解决All com.android.support libraries must use the exact same version specification

在导入第三方的时候报了这么一个错误com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.0.2, 23.1.1. Examples include `com.android...

qq_36366823的博客 690

FFTW多核优化避坑指南:从交叉编译到ELF2板载OpenMP部署全流程

本文详细介绍了在ELF2开发板(RK3588平台)上为FFTW库配置OpenMP多核并行的完整流程与避坑指南。内容涵盖从交叉编译、库依赖处理到板载部署的实战步骤,并深入分析了RK3588的big.LITTLE架构对线程调优的影响,帮助开发者在嵌入式环境中高效利用多核性能。

2a4s6d8f0g的博客 278

电商订单系统设计简析(一)

电商所有模块中,订单系统作为最为核心的模块,决定了整个流程能不能顺畅的执行,起着承上启下的作用。相信很多PM都不陌生,到了一家电商公司,总会觉得公司现有的流程有不少问题,因为问题来自四面八方,一下子摸不着到底是哪里出了问题,PM就跟补丁师傅一样,遇到一个补一个。其实很多日常开发和测试提得需求都是表面需求,而这些表面上呈现出的各种问题,都是源自于流程上的不完整或者流程上某个环节上的缺失导致的。订单系...

野蛮非先生的博客 9563

android 最新 support,所有com.android.support库必须使用完全相同的版本规范

所有com.android.support库必须使用完全相同的版本规范更新到android studio 2.3后,我收到此错误消息。我知道这只是一个暗示,因为应用程序正常运行,但它真的很奇怪。所有com.android.support库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。找到的版本25.1.1,24.0.0。示例包括com.android.support:animated-...

weixin_30369405的博客 706

从零到一:手把手部署用友T3标准版11.2及SQL Server 2008R2环境

本文详细介绍了从零开始部署用友T3标准版11.2及SQL Server 2008R2环境的完整流程,包括环境准备、SQL Server安装、环境检测与修复、T3标准版安装实战以及初始化配置与测试。通过手把手的步骤指导和常见问题解决方案,帮助用户顺利完成部署,确保系统稳定运行。

weixin_28339967的博客 477

com.android.support:support-v4:25.1.1,所有com.android.support库都必须使用完全相同的版本规范...

问题:After updating to android studio 2.3 I got this error message. 更新到android studio 2.3后,我收到此错误消息。 I know it's just a hint as the app run normally but it's really strange. 我知道这只是应用正常运行的提示,但确实很奇怪。All c...

weixin_36015213的博客 837

解放双手,摆脱自建库的繁琐,立创EDA元件库转cadence原理图封装库实战技巧

解放双手,摆脱自建库的繁琐,立创EDA元件库转cadence原理图封装库实战技巧

u012790770的博客 3653

Arduino与Proteus仿真实例-LCD2004-I2C(PCF8574)驱动仿真

LCD2004-I2C(PCF8574)驱动仿真 PCF8574/74A 通过两线双向 I2C 总线(串行时钟 (SCL)、串行数据 (SDA))提供通用远程 I/O 扩展。 LCD2004,即2004字符型液晶显示器,是一种点阵模块,用于显示字母、数字、字符等。 它由 5x8 个点阵位置组成; 每个位置可以显示一个字符。 两个字符之间有一个点间距,行之间有一个空格,从而将字符和行分开。 模型 2004 表示它显示 4 行,每行 20 个字符。 在前面的实例中对PCF8574和LCD2004的已经做了详细介

视觉与物联智能 1170

android与gms的区别,所有com.google.android.gms库必须使用完全相同的版本规范吗?

我在行compile 'com.google.android.gms:play-services-analytics:9.2.0'的构建等级中收到以下警告消息。这是什么意思?All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to r...

weixin_33501343的博客 4059

机器学习扩散模型简介

​ 扩散模型是生成模型,在过去几年中越来越受欢迎,这是有充分理由的。仅在 2020 年代发布的几篇开创性论文就向世界展示了 Diffusion 模型的能力,例如在图像合成方面击败 GAN[6]。最近,从业者将看到DALL-E 2(OpenAI 上个月发布的图像生成模型)中使用的扩散模型。

gongdiwudu的专栏 4308

关于解决com.android.support的版本冲突问题

项目报错信息: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes 报错的原因:在使用Android Studio的时候,在build.gradle文件引用第三方的依赖库的时候,有时会出现上面的错误信...

奥帕斯特李立理与鲤的博客 547

ISP 芯片作为独立设备节点的驱动实现要点:多平台结构差异与工程部署策略解析

随着 ISP(Image Signal Processor)从 SoC 集成形态向独立芯片模块演进,在多摄系统、高动态场景、AI 图像前处理等需求下,ISP 作为单独设备节点进行驱动设计已成为主流趋势。尤其在多 SoC 平台(如高通、联发科、展锐、Rockchip)中,不同厂商对 ISP 的抽象方式与驱动接口处理存在显著差异。本文以实际工程为基础,从 Linux 内核下的设备注册流程、media\_entity 配置、VideoDevice 分配、数据 DMA 管理、与 sensor 的流同步控制等关键点展

努力分享一些人工智能、计算机视觉、影像等相关的知识干货! 1477

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

谷歌android规范,所有com.google.android.gms库必须使用完全相同的版本规范吗?

我在构建等级中收到以下警告消息,用于行编译’com.google.android.gms:play-services-analytics:9.2.0′.这是什么意思?All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runti...

weixin_39995764的博客 675

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

PX4 Autopilot GNSS 指南:从硬件连接、双 GPS 配置到数据融合与源码实现

本篇围绕 PX4 的 GNSS(GPS/罗盘)子系统展开,覆盖多接收机型号支持、Pixhawk 标准端口接线、主/从 GPS 串口配置、DroneCAN GNSS 接入,并结合 [GPS 驱动源码](https://link.gitcode.com/i/a23c5023f1e9043f7c06d5fdf9a01875) 与 [SensorGps uORB 消息定义](https://link.gi

gitblog_01117的博客 219

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

Android Studio com.android.support:percent 导入错误

看第一行代码(第二版的)书,讲了一个关于PercentFrameLayout和PercentRelativeLayout的部分,书上在build.gradle中导入了com.android.support:percent:24.2.1的包。

生活不止眼前的苟且 1万+

All com.android.support libraries must use the exact same version specification (mixing versions can

All com.android.support libraries must use the exact same version specification (mixing versions can configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details ->...

墨浅 294

Android Support Library与AndroidX开发指南

Android兼容性开发是移动应用适配不同系统版本的核心技术。通过Support Library及其进化版AndroidX,开发者可以实现新API在老版本系统上的向后兼容,其原理主要基于运行时版本检测、代理模式和功能降级等技术方案。这类兼容层技术大幅降低了Android碎片化带来的开发成本,广泛应用于Fragment、RecyclerView等核心组件的跨版本支持。随着Jetpack组件库的完善,AndroidX已成为现代Android开发的基础设施,特别是在处理Material Design组件和权限管理

afeyfre41671的博客 445

android开发版本,Android开发之版本统一规范

Android开发存在着众多版本的不同,比如compileSdkVersion、minSdkVersion、targetSdkVersion以及项目中依赖第三方库的版本,不同的module及不同的开发人员都有不同的版本,所以需要一个统一版本规范的文件,现在我就来介绍一种方式:配置config.gradle文件。在项目根目录,也就是跟app同一目录下的地方新建config.gradle文件,如下图所...

weixin_29239661的博客 397

Android Studio com.android.support:percent 导入错误 - 转

看第一行代码(第二版的)书,讲了一个关于PercentFrameLayout和PercentRelativeLayout的部分,书上在build.gradle中导入了com.android.support:percent:24.2.1的包。 compile 'com.android.support:appcompat-v7:26.+' compile 'com.androi...

weixin_30525825的博客 350

Android API兼容性终极指南:Fab库在不同版本上的表现与优化技巧

在Android应用开发中,**API兼容性**是每个开发者都必须面对的挑战。特别是对于**Fab库(Floating Action Button Library)**这样的UI组件库,确保在不同Android版本上的一致表现至关重要。本文将深入探讨Fab库的API兼容性策略,帮助开发者理解如何在不同Android版本上获得最佳用户体验。🔍 ## 📱 Fab库支持的Android版本范围

gitblog_00044的博客 932

还在用android.support?该考虑迁移AndroidX了!

AndroidX是Google 2018 IO 大会推出的新扩展库,主要是对Android 支持库做了重大改进。与支持库一样,AndroidX 与 Android 操作系统分开提供,并与各个 Android 版本向后兼容,可以说AndroidX就是为了替换Android支持库而设计的。 AndroidX是什么? AndroidX 是 Android 团队用于在 Jetpack 中开发、测试、打...

伯兮的专栏 9570
上一篇: 如何使IPython Notebook Matplotlib内联绘图
下一篇: Java“双支撑初始化”的效率?
w36680130
博客等级 码龄8年 168粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值